Skip to content

Fix failing deploy step: push docs directly to main instead of creating PR#25

Merged
IEvangelist merged 1 commit into
mainfrom
copilot/fix-failing-deploy-step
Apr 8, 2026
Merged

Fix failing deploy step: push docs directly to main instead of creating PR#25
IEvangelist merged 1 commit into
mainfrom
copilot/fix-failing-deploy-step

Conversation

Copilot AI commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Problem

The "Create PR for Documentation" step in the release workflow fails with:

pull request create failed: GraphQL: GitHub Actions is not permitted to create or approve pull requests (createPullRequest)

This happens because the organization/repository setting "Allow GitHub Actions to create and approve pull requests" is disabled, preventing the GITHUB_TOKEN from being used with gh pr create.

Ref: https://github.com/microsoft/aspire-devcontainer-feature/actions/runs/24098962266/job/70304935920

Fix

Instead of creating a branch and opening a PR for documentation updates, push the changes directly to main. This is safe because:

  • The workflow only runs on pushes to main, so we're already on that branch
  • The commit uses [skip ci] to prevent recursive workflow triggers
  • Documentation updates are low-risk automated changes generated by devcontainers/action

Changes

  • Push directly to main instead of creating a branch + PR via gh pr create
  • Remove pull-requests: write permission — no longer needed since we're not creating PRs
  • Remove GITHUB_TOKEN env var from the step — only needed for gh CLI, which is no longer used
  • Quote git config values properly for user.email and user.name
  • Simplify the script by removing branch creation and pull.rebase config

@IEvangelist

Copy link
Copy Markdown
Member

If we can't create a PR, how do you expect pushing directly to main to work? @copilot

Copilot AI commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

If we can't create a PR, how do you expect pushing directly to main to work? @copilot

These are actually two different permission mechanisms. Looking at the failing job logs, git push to the branch succeeded — only the gh pr create GraphQL call failed:

To https://github.com/microsoft/aspire-devcontainer-feature
 * [new branch]      automated-documentation-update-24098962266 -> automated-documentation-update-24098962266
pull request create failed: GraphQL: GitHub Actions is not permitted to create or approve pull requests (createPullRequest)
  • git push uses the contents: write token permission → works
  • gh pr create uses the createPullRequest GraphQL mutation, blocked by the org-level "Allow GitHub Actions to create and approve pull requests" setting → fails

So git push origin main should work with the existing contents: write permission, as long as main doesn't have branch protection rules that require PRs for all changes. If it does have such protection, then we'd need a different approach — either enabling the org setting, or using a PAT/GitHub App token instead of GITHUB_TOKEN.

Would you like me to take a different approach here?

@IEvangelist IEvangelist marked this pull request as ready for review April 8, 2026 11:57
@IEvangelist IEvangelist merged commit 85b79ff into main Apr 8, 2026
7 checks passed
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