Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

The dependabot auto-approve workflow fails with GraphQL: GitHub Actions is not permitted to approve pull requests because the default GITHUB_TOKEN cannot approve PRs via gh pr review --approve.

Changes

  • Replaced gh pr review --approve with hmarr/auto-approve-action@v4 - Uses GitHub API method compatible with default GITHUB_TOKEN
  • Changed trigger from pull_request to pull_request_target - Required for Dependabot PRs to access workflow secrets
  • Added contextual review messages - Include dependency names and update type
# Before
- run: gh pr review --approve "$PR_URL"
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# After  
- uses: hmarr/auto-approve-action@v4
  with:
    review-message: "Auto-approved ${{ steps.metadata.outputs.update-type }} update for ${{ steps.metadata.outputs.dependency-names }}"

Security boundary unchanged: workflow only runs for github.actor == 'dependabot[bot]' and doesn't execute PR code.

Original prompt

help me fix this action error - Run echo "Auto-approving dependabot/fetch-metadata"
Auto-approving dependabot/fetch-metadata
failed to create review: GraphQL: GitHub Actions is not permitted to approve pull requests. (addPullRequestReview)
Error: Process completed with exit code 1.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Note

Ensures Dependabot PRs can be auto-approved and tweaks CI pre-commit behavior.

  • Dependabot workflow: switched to pull_request_target and replaced gh pr review --approve with hmarr/auto-approve-action@v4, adding contextual review-message; still gated to github.actor == 'dependabot[bot]'
  • CI: pre-commit now skips poetry-lock and poetry-check via SKIP env in ci.yml

Written by Cursor Bugbot for commit ecbbc02. This will update automatically on new commits. Configure here.

Co-authored-by: cayossarian <23534755+cayossarian@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error in auto-approving dependabot fetch-metadata Fix dependabot auto-approve workflow GitHub Actions permission error Jan 19, 2026
Copilot AI requested a review from cayossarian January 19, 2026 06:28
CI modifies pyproject.toml to replace path dependencies with PyPI versions,
which causes the poetry-lock hook to fail since the lock file differs.
Since CI already runs poetry lock explicitly, these checks are redundant.
@cayossarian cayossarian marked this pull request as ready for review January 19, 2026 06:45
@cayossarian cayossarian merged commit 3290e2a into main Jan 19, 2026
7 checks passed
@cayossarian cayossarian deleted the copilot/fix-dependabot-approval-error branch January 19, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants