Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: use github-actions token for merging PR #23

Merged
merged 4 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ jobs:
permissions:
contents: write
id-token: write
pull-request: write
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For visibility: If I'm not mistaken, this bug is related and the linked comment explains why this is the proper fix:
actions/labeler#12 (comment)

cc @jamesmbourne

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fixed this action here which is probably the real related one: https://github.com/contentful/jobs-api/pull/5220/commits/0d4d66f488d43d8b4642ee1a1433a66408d5533f

runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- uses: contentful/github-auto-merge@v1
- uses: contentful/github-auto-merge@v2
with:
VAULT_URL: ${{ secrets.VAULT_URL }} # this is an organisation level secret, you do not need to add it to your repo
```
Expand Down
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ runs:
echo "Auto merging PR using method $merge_method"
gh pr merge --delete-branch "--$merge_method" --auto ${{ github.event.pull_request.html_url }}
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_MERGE_TOKEN }}
# Note: The GH_TOKEN env var is required for now, even though it contradicts GH's documentation. If not present we
# were seeing an error message like this one: https://github.com/github/docs/issues/21930#issuecomment-1310122605
GH_TOKEN: ${{ github.token }}
1 change: 1 addition & 0 deletions example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
permissions:
contents: write
id-token: write
pull-request: write
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
Expand Down