-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(attach-artifact-release.yml): update GitHub token to use BOT_TOKE…
…N instead of GITHUB_TOKEN for API authentication feat(attach-artifact-release.yml): add support for storing previous release body as an artifact feat(attach-artifact-release.yml): update dependencies installation step feat(attach-artifact-release.yml): update upload actions to use BOT_TOKEN for authentication feat(attach-artifact-release.yml): add step to get latest release ID using BOT_TOKEN for authentication feat(attach-artifact-release.yml): update Edit Release action to use BOT_TOKEN for authentication
- Loading branch information
jandroav
committed
Dec 10, 2023
1 parent
9e0a79a
commit 8e00975
Showing
1 changed file
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,14 +28,14 @@ jobs: | |
|
||
- name: Backup release body | ||
run: | | ||
release_id=$(curl -X GET -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases?per_page=1 | jq -r '.[] | select(.name == "${{ env.artifact_id }}") | .id') | ||
release_id=$(curl -X GET -H "Authorization: token ${{ secrets.BOT_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases?per_page=1 | jq -r '.[] | select(.name == "${{ env.artifact_id }}") | .id') | ||
# Check if release_id is empty | ||
if [ -z "$release_id" ]; then | ||
echo "Release '$release_name' not found in the repository '$repo'." | ||
exit 1 | ||
fi | ||
release_url="https://api.github.com/repos/${{ github.repository }}/releases/$release_id" | ||
curl -X GET -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$release_url" | jq -r .body > release_body.txt | ||
curl -X GET -H "Authorization: token ${{ secrets.BOT_TOKEN }}" "$release_url" | jq -r .body > release_body.txt | ||
- name: Store previous release body as artifact | ||
uses: actions/upload-artifact@v2 | ||
|
@@ -47,7 +47,7 @@ jobs: | |
uses: dev-drprasad/[email protected] | ||
with: | ||
tag_name: ${{ env.artifact_id }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
github_token: ${{ secrets.BOT_TOKEN }} | ||
delete_release: true | ||
|
||
- name: Install dependencies | ||
|
@@ -61,7 +61,7 @@ jobs: | |
- name: Upload Windows binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
repo_token: ${{ secrets.BOT_TOKEN }} | ||
file: vtrain_windows.zip | ||
asset_name: vtrain_windows_$tag.zip | ||
tag: ${{ env.artifact_id }} | ||
|
@@ -70,7 +70,7 @@ jobs: | |
- name: Upload Linux binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
repo_token: ${{ secrets.BOT_TOKEN }} | ||
file: vtrain_linux.zip | ||
asset_name: vtrain_linux_$tag.zip | ||
tag: ${{ env.artifact_id }} | ||
|
@@ -79,7 +79,7 @@ jobs: | |
- name: Upload macOS Silicon binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
repo_token: ${{ secrets.BOT_TOKEN }} | ||
file: vtrain_mac_arm.zip | ||
asset_name: vtrain_mac_arm_$tag.zip | ||
tag: ${{ env.artifact_id }} | ||
|
@@ -88,7 +88,7 @@ jobs: | |
- name: Upload macOS Intel binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
repo_token: ${{ secrets.BOT_TOKEN }} | ||
file: vtrain_mac_intel.zip | ||
asset_name: vtrain_mac_intel_$tag.zip | ||
tag: ${{ env.artifact_id }} | ||
|
@@ -97,14 +97,14 @@ jobs: | |
- name: Get latest release ID | ||
id: get-release | ||
run: | | ||
LATEST_RELEASE=$(curl -X GET -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases?per_page=1" | jq -r '.[].id') | ||
LATEST_RELEASE=$(curl -X GET -H "Authorization: token ${{ secrets.BOT_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases?per_page=1" | jq -r '.[].id') | ||
echo "Latest Release ID: $LATEST_RELEASE" | ||
echo "RELEASE_ID=$LATEST_RELEASE" >> $GITHUB_ENV | ||
- name: Edit Release | ||
uses: irongut/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.BOT_TOKEN }} | ||
id: ${{ env.RELEASE_ID }} | ||
name: ${{ env.artifact_id }} | ||
replacename: true |