Skip to content

Commit 455cec1

Browse files
boomzeroclaude
andcommitted
Allow metadata updates on edited PRs after bot version commit
The last-commit-author guard now only exits for non-edited events, so PR title/body changes still update Update.json metadata even when the branch tip is a github-actions[bot] commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent caf1ee0 commit 455cec1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/UpdateVersion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
- name: Update version
2727
env:
2828
PR_BODY: ${{ github.event.pull_request.body }}
29-
run: node ./Update/UpdateVersion.js ${{ steps.generate_token.outputs.token }} ${{ github.event.number }} "${{ github.event.pull_request.title }}" "$PR_BODY"
29+
run: node ./Update/UpdateVersion.js ${{ steps.generate_token.outputs.token }} ${{ github.event.number }} "${{ github.event.pull_request.title }}" "$PR_BODY" "${{ github.event.action }}"

Update/UpdateVersion.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ execSync("gh pr checkout " + PRNumber);
88
console.info("PR #" + PRNumber + " has been checked out.");
99

1010
// Check if the last commit was made by github-actions[bot]
11+
// Only skip for synchronize events (push-triggered) to prevent infinite loops.
12+
// For edited events (PR title/body changes), allow metadata updates even when
13+
// the branch tip is a bot commit.
14+
const eventAction = String(process.argv[6] || "");
1115
const lastCommitAuthor = execSync("git log -1 --pretty=format:'%an'").toString().trim();
1216
console.log("Last commit author: " + lastCommitAuthor);
13-
if (lastCommitAuthor === "github-actions[bot]") {
17+
console.log("Event action : " + eventAction);
18+
if (lastCommitAuthor === "github-actions[bot]" && eventAction !== "edited") {
1419
console.log("Last commit was made by github-actions[bot]. Skipping to prevent infinite loop.");
1520
process.exit(0);
1621
}

0 commit comments

Comments
 (0)