-
Notifications
You must be signed in to change notification settings - Fork 1
ci: fix the bug of pr-cancel and Autobuild #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ jobs: | |
| uses: actions/github-script@v8 | ||
| with: | ||
| script: | | ||
| const workflows = ['pr-build.yml', 'system-test.yml']; | ||
| const workflows = ['pr-build.yml', 'system-test.yml', 'codeql.yml', 'coverage-waiting.yml']; | ||
| const headSha = context.payload.pull_request.head.sha; | ||
| const prNumber = context.payload.pull_request.number; | ||
|
|
||
|
|
@@ -36,7 +36,7 @@ jobs: | |
| ); | ||
|
|
||
| for (const run of runs) { | ||
| const isTargetPr = run.pull_requests?.some((pr) => pr.number === prNumber); | ||
| const isTargetPr = !run.pull_requests?.length || run.pull_requests.some((pr) => pr.number === prNumber); | ||
| if (run.head_sha === headSha && isTargetPr) { | ||
|
Comment on lines
+39
to
40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 39 fallback is too broad and may cancel the wrong PR run. When 🔧 Suggested fix- const isTargetPr = !run.pull_requests?.length || run.pull_requests.some((pr) => pr.number === prNumber);
- if (run.head_sha === headSha && isTargetPr) {
+ const isTargetPr = run.pull_requests?.length
+ ? run.pull_requests.some((pr) => pr.number === prNumber)
+ : (run.head_sha === headSha &&
+ run.head_branch === context.payload.pull_request.head.ref);
+ if (isTargetPr) {🤖 Prompt for AI Agents |
||
| await github.rest.actions.cancelWorkflowRun({ | ||
| owner: context.repo.owner, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
actions/download-artifact v7 release notes💡 Result:
actions/download-artifact@v7.0.0 release notes (highlights)
runs.using: node24) and requires a minimum Actions Runner version 2.327.1 (update self-hosted runners before upgrading). [1]@actions/artifactto address a Node.js 24punycodedeprecation. [1]Source: GitHub release page for
v7.0.0. [1]Verify self-hosted runner compatibility with
actions/download-artifact@v7.v7is valid and released, but introduces breaking changes: it requires Node.js 24 runtime and Actions Runner version 2.327.1 or later. If this repository uses self-hosted runners, confirm they meet the minimum version requirement before merging, as workflows will fail otherwise. GitHub-hosted runners are auto-updated and compatible. Therun-idandgithub-tokenparameters remain compatible.🤖 Prompt for AI Agents