You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,16 @@ The project follows [Semantic Versioning](https://semver.org/) and adheres to th
8
8
9
9
- Nothing yet.
10
10
11
+
## [1.6.0] - 2025-10-10
12
+
13
+
### Added
14
+
15
+
- Include a workflow warning in generated pull request bodies when `.github/workflows/**` files change.
16
+
17
+
### Fixed
18
+
19
+
- Skip runs that would edit `.github/workflows/**` unless the provided token is a personal access token with the `workflow` scope, preventing GitHub App permission errors.
Copy file name to clipboardExpand all lines: README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,11 +217,13 @@ This workflow requires:
217
217
permissions:
218
218
contents: write
219
219
pull-requests: write
220
+
```
220
221
221
222
In addition to per-job permissions, the repository (or organization) wide setting under **Settings → Actions → General → Workflow permissions** must grant **Read and write permissions** and enable **“Allow GitHub Actions to create and approve pull requests”**. If that toggle cannot be enabled, provide a classic personal access token with `repo` scope via a secret (for example `PATCH_PR_TOKEN`) and export it as `GITHUB_TOKEN` when running the action.
222
223
223
224
Commits authored by the action default to the current `GITHUB_ACTOR` (falling back to `github-actions[bot]`). Override this by setting `GIT_AUTHOR_NAME` and `GIT_AUTHOR_EMAIL` (and matching `GIT_COMMITTER_*`) in the workflow environment before invoking the action if you need a custom identity.
224
-
```
225
+
226
+
> **Note:** The default `GITHUB_TOKEN` cannot push updates to `.github/workflows/**`. If the action needs to rewrite workflow files, supply a personal access token that includes the `workflow` scope (often via a secret mapped to `GITHUB_TOKEN`). Runs without that scope will skip applying workflow changes and exit with `workflow_permission_required`.
225
227
226
228
## FAQ
227
229
@@ -253,3 +255,7 @@ MIT. See `LICENSE`.
253
255
> Like this Action? Star the repo. Adopt it in your org. Share feedback via issues or PRs.
254
256
255
257
GitHub Action for zero-maintenance CPython patch updates across your repo.
core.warning(`This run detected workflow changes (${workflows}) but the provided token lacks workflow write permissions. Provide a personal access token with the "workflow" scope and set it as GITHUB_TOKEN to apply these updates.`);
81020
+
break;
81021
+
}
80983
81022
default:
80984
81023
core.info(`Skipping with reason ${result.reason}.`);
80985
81024
break;
@@ -81016,6 +81055,9 @@ function summarizeResult(result) {
`- Bump CPython ${track} pins to \`${newVersion}\`.`,
@@ -81176,25 +81218,12 @@ function generatePullRequestBody(options) {
81176
81218
'',
81177
81219
filesSection,
81178
81220
'',
81179
-
'## Rollback',
81180
-
'',
81181
-
'Before merge, close this PR and delete the branch:',
81182
-
'',
81183
-
'```sh',
81184
-
`git push origin --delete ${branchName}`,
81185
-
'```',
81186
-
'',
81187
-
`After merge, revert the change on ${defaultBranch}:`,
81188
-
'',
81189
-
'```sh',
81190
-
`git checkout ${defaultBranch}`,
81191
-
`git pull --ff-only origin ${defaultBranch}`,
81192
-
'git revert --no-edit <merge_commit_sha>',
81193
-
`git push origin ${defaultBranch}`,
81194
-
'```',
81195
-
'',
81196
-
'Replace `<merge_commit_sha>` with the SHA of the merge commit if rollback is required.',
81197
-
].join('\n');
81221
+
];
81222
+
if (skippedWorkflowFiles && skippedWorkflowFiles.length > 0) {
81223
+
bodySections.push('## ⚠️ Workflow File Notice', '', 'The following workflow files were detected but left unchanged because the provided token lacks the `workflow` scope:', '', ...skippedWorkflowFiles.map((file) => `- \`${file}\``), '', 'Provide a personal access token with the `workflow` scope (for example via `GITHUB_TOKEN`) before rerunning to update these files automatically.', '');
81224
+
}
81225
+
bodySections.push('## Rollback', '', 'Before merge, close this PR and delete the branch:', '', '```sh', `git push origin --delete ${branchName}`, '```', '', `After merge, revert the change on ${defaultBranch}:`, '', '```sh', `git checkout ${defaultBranch}`, `git pull --ff-only origin ${defaultBranch}`, 'git revert --no-edit <merge_commit_sha>', `git push origin ${defaultBranch}`, '```', '', 'Replace `<merge_commit_sha>` with the SHA of the merge commit if rollback is required.');
`This run detected workflow changes (${workflows}) but the provided token lacks workflow write permissions. Provide a personal access token with the "workflow" scope and set it as GITHUB_TOKEN to apply these updates.`,
182
+
);
183
+
break;
184
+
}
176
185
default:
177
186
core.info(`Skipping with reason ${result.reason}.`);
178
187
break;
@@ -214,6 +223,11 @@ function summarizeResult(result: ExecuteResult): void {
0 commit comments