mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-29 00:21:56 -05:00
Let PR Authors Ask for the Sliced G-code Comparison With the check-gcode Label
The label bot accepts check-gcode and says when the comment will come: when the build finishes if its app token starts workflows, otherwise when the running build finishes or after the next push that builds. CONTRIBUTING.md says what the label does and which pull requests can get a report.
This commit is contained in:
1 parent
49252d14b7
commit
2fa02ab758
2 files changed
+29
-2
No files matched your search
@@ -53,7 +53,9 @@ jobs:
|
||||
'build-macos-x86_64',
|
||||
'build-windows-arm64',
|
||||
'build-windows-msvc',
|
||||
'build-all'
|
||||
'build-all',
|
||||
// sliced G-code comparison with the base branch (check_gcode_comment.yml)
|
||||
'check-gcode'
|
||||
];
|
||||
const pr = context.payload.pull_request;
|
||||
// First-time contributors also get a link to the contributing guide
|
||||
@@ -255,7 +257,9 @@ jobs:
|
||||
'build-macos-x86_64',
|
||||
'build-windows-arm64',
|
||||
'build-windows-msvc',
|
||||
'build-all'
|
||||
'build-all',
|
||||
// sliced G-code comparison with the base branch (check_gcode_comment.yml)
|
||||
'check-gcode'
|
||||
];
|
||||
|
||||
const issue = context.payload.issue;
|
||||
@@ -374,6 +378,28 @@ jobs:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (uniqueRequestedLabels.includes('check-gcode')) {
|
||||
// A label added with the workflow token starts no workflow, so without the app
|
||||
// token the comment waits for a build to finish.
|
||||
const when = process.env.STARTS_WORKFLOWS === 'true'
|
||||
? 'is posted when the build of the latest commit finishes, or shortly if it already has'
|
||||
: 'is posted when the running build finishes, or after the next push that builds; a PR that changes no built file gets none';
|
||||
try {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
body: `@${commenter} the comparison of this PR's sliced G-code with its base branch ${when}.`
|
||||
});
|
||||
} catch (error) {
|
||||
if (isPermissionDenied(error)) {
|
||||
core.warning('Cannot post the check-gcode label reply because token cannot write comments.');
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (action === 'remove' && uniqueRequestedLabels.length) {
|
||||
|
||||
Reference in new issue
Block a user