-
Notifications
You must be signed in to change notification settings - Fork 217
notify slack and triage labels #2211
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 | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,23 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Update label | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: andymckay/labeler@master | ||||||||||||||||||||||||||||||||||||||||||||||||
| # actions/github-script v8, checked 2026-04-26. | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| add-labels: "Triage 👀" | ||||||||||||||||||||||||||||||||||||||||||||||||
| remove-labels: "Awaiting Response" | ||||||||||||||||||||||||||||||||||||||||||||||||
| script: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| const { owner, repo } = context.repo; | ||||||||||||||||||||||||||||||||||||||||||||||||
| const issue_number = context.issue.number; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| await github.rest.issues.addLabels({ | ||||||||||||||||||||||||||||||||||||||||||||||||
| owner, | ||||||||||||||||||||||||||||||||||||||||||||||||
| repo, | ||||||||||||||||||||||||||||||||||||||||||||||||
| issue_number, | ||||||||||||||||||||||||||||||||||||||||||||||||
| labels: ["Triage 👀"], | ||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| await github.rest.issues.removeLabel({ | ||||||||||||||||||||||||||||||||||||||||||||||||
| owner, | ||||||||||||||||||||||||||||||||||||||||||||||||
| repo, | ||||||||||||||||||||||||||||||||||||||||||||||||
| issue_number, | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: "Awaiting Response", | ||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+27
to
+32
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. 🧩 Analysis chain🌐 Web query:
💡 Result: The GitHub REST API endpoint for removing a label from an issue (DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}, corresponding to issues.removeLabel in client libraries like Octokit) returns a 404 Not Found status code when the target label is not present on the issue. Citations:
Make label removal idempotent to prevent flaky failures. The Proposed patch await github.rest.issues.addLabels({
owner,
repo,
issue_number,
labels: ["Triage 👀"],
});
- await github.rest.issues.removeLabel({
- owner,
- repo,
- issue_number,
- name: "Awaiting Response",
- });
+ try {
+ await github.rest.issues.removeLabel({
+ owner,
+ repo,
+ issue_number,
+ name: "Awaiting Response",
+ });
+ } catch (error) {
+ if (error.status !== 404) throw error;
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
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.
run_idis treated as required at runtime but optional in inputs.Line 43 always builds
RUN_URLfrominputs.run_id. If callers omit it, Slack gets a broken run link. Either makerun_idrequired or add explicit fallback/guard logic.Proposed fix (make input contract explicit)
on: workflow_call: inputs: run_id: type: string - required: false + required: true🤖 Prompt for AI Agents