Skip to content

Commit

Permalink
patch(update_bundle.yaml): Use token to push branch (#46)
Browse files Browse the repository at this point in the history
If GITHUB_TOKEN is used to push branch, any CI triggered on
`pull_request` will not run.
  • Loading branch information
carlcsaposs-canonical authored May 23, 2023
1 parent 86f8bfa commit 09f1ce6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/update_bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ jobs:
reviewers: canonical/data-platform-engineers,octocat
secrets:
token: ${{ secrets.CREATE_PR_APP_TOKEN }}
permissions:
contents: write # Needed to push branch to GitHub
```
5 changes: 3 additions & 2 deletions .github/workflows/update_bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ on:
Permissions needed for App token:
- Access: Read & write for Repository permissions: Pull requests
- Access: Read & write for Repository permissions: Contents
- If GitHub team is requested for pull request review,
Access: Read-only for Organization permissions: Members
Permissions needed for personal access token: write access to repository, read:org
Personal access tokens with fine grained access are not supported (by GraphQL API, which is used by GitHub CLI).
The GITHUB_TOKEN can create a pull request, but `on: pull_request` workflows will not be triggered.
The GITHUB_TOKEN can create a pull request or push a branch, but `on: pull_request` workflows will not be triggered.
Source: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
required: true
Expand Down Expand Up @@ -74,7 +75,7 @@ jobs:
git commit -m "Update bundle"
git push origin update-bundle -f
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.token }}
- name: Create pull request
if: ${{ fromJSON(steps.update-file.outputs.updates_available) }}
working-directory: bundle-repo
Expand Down

0 comments on commit 09f1ce6

Please sign in to comment.