Skip to content

Commit a5a1ab6

Browse files
authored
Merge pull request #28 from RTGS-Lab/bug/workflow_permissions
Correcting workflow logic so App token is always created and token is used for checkout. Also directly pushes instead of using push action.
2 parents c782b16 + d37c227 commit a5a1ab6

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

.github/workflows/release-workflow.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ jobs:
3333
firmware-version-updated: ${{ steps.compile.outputs.firmware-version-updated }}
3434
release-url: ${{ steps.release.outputs.html_url }}
3535
steps:
36-
# Generate a GitHub App token using the official action
36+
# Generate a GitHub App token using the official action - UNCONDITIONALLY
3737
- name: Create GitHub App token
3838
id: app-token
39-
if: steps.compile.outputs.firmware-version-updated == 'true'
4039
uses: actions/create-github-app-token@v2
4140
with:
4241
app-id: ${{ secrets.APP_ID }}
@@ -79,10 +78,8 @@ jobs:
7978
# When a GitHub Action pushes commits or tags, it does not trigger a new GitHub Action job
8079
- name: Push changes
8180
if: steps.compile.outputs.firmware-version-updated == 'true'
82-
uses: ad-m/github-push-action@v0.6.0
83-
with:
84-
github_token: ${{ steps.app-token.outputs.token }}
85-
branch: ${{ github.ref }}
81+
run: |
82+
git push origin HEAD:${{ github.ref_name }}
8683
8784
- name: Create archive of target directory
8885
if: steps.compile.outputs.firmware-version-updated == 'true'
@@ -100,7 +97,7 @@ jobs:
10097
name: "Firmware v${{ steps.compile.outputs.firmware-version }}"
10198
tag: "v${{ steps.compile.outputs.firmware-version }}"
10299
commit: ${{ steps.commit.outputs.updated-version-sha || github.sha }}
103-
token: ${{ secrets.GITHUB_TOKEN }}
100+
token: ${{ steps.app-token.outputs.token }}
104101

105102
upload:
106103
name: Upload to Particle

0 commit comments

Comments
 (0)