Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 27, 2025

The auto-merge GitHub Actions workflow was failing with the error:

gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable. Example:
  env:
    GH_TOKEN: ${{ github.token }}
Error: Process completed with exit code 4.

The issue was that the workflow was using GITHUB_TOKEN as the environment variable name, but the GitHub CLI (gh command) specifically requires GH_TOKEN when running in GitHub Actions.

This PR fixes the environment variable names in two places in .github/workflows/auto-merge.yml:

  • The gh pr review --approve command
  • The gh pr merge --auto --squash --delete-branch command

Both now correctly use GH_TOKEN instead of GITHUB_TOKEN, following the same pattern already used successfully in the post-release-version-bump.yml workflow.

The fix is minimal and surgical - only 2 lines changed in 1 file, preserving all existing functionality while resolving the build failure.

Fixes #37.


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

Co-authored-by: warting <657973+warting@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build issue Fix GitHub CLI token environment variable in auto-merge workflow Aug 27, 2025
Copilot AI requested a review from warting August 27, 2025 09:03
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.

Fix build issue

2 participants