Fix: Properly handle workflow file modifications in releases#16
Merged
adityamaru merged 1 commit intomasterfrom Nov 19, 2025
Merged
Fix: Properly handle workflow file modifications in releases#16adityamaru merged 1 commit intomasterfrom
adityamaru merged 1 commit intomasterfrom
Conversation
- Remove invalid 'workflows' permission (doesn't exist in GitHub Actions) - Use WORKFLOW_TOKEN (PAT) for operations that modify workflow files - Fall back to GITHUB_TOKEN if PAT not configured - Add setup documentation for creating Personal Access Token The GITHUB_TOKEN cannot push changes to workflow files by design. When patches include workflow modifications, a PAT with workflow scope is required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The previous fix incorrectly added
workflows: writepermission, which doesn't exist in GitHub Actions. The actual issue is that the defaultGITHUB_TOKENcannot push changes to workflow files for security reasons.Root Cause
When cherry-picking patches that modify workflow files, GitHub prevents the default token from pushing these changes with the error:
Solution
workflows: writepermissionWORKFLOW_TOKEN(if configured) or fall back toGITHUB_TOKENSetup Required
To handle patches that modify workflows:
repoandworkflowscopesWORKFLOW_TOKENsecret in repository settingsIf no PAT is configured, the workflows will use
GITHUB_TOKENand work normally for patches that don't modify workflows.Testing
WORKFLOW_TOKEN: Works for regular patchesWORKFLOW_TOKEN: Can cherry-pick and push patches that modify workflow filesNote
Switch workflows to use WORKFLOW_TOKEN (falling back to GITHUB_TOKEN) and remove the invalid workflows: write permission; add PAT setup instructions to DEPLOYMENT.md.
/.github/workflows/rebase-upstream.yml,/.github/workflows/release-patched-version.yml:secrets.WORKFLOW_TOKEN || secrets.GITHUB_TOKENfor checkouttoken.workflows: writepermission.DEPLOYMENT.md: Add Personal Access Token setup requirements and notes for handling workflow file changes.Written by Cursor Bugbot for commit e6f0577. This will update automatically on new commits. Configure here.