-
Notifications
You must be signed in to change notification settings - Fork 13
Allow skipping check with a 'no-issue' label on the PR #650
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
Allow skipping check with a 'no-issue' label on the PR #650
Conversation
No linked issues found. Please add the corresponding issues in the pull request description. |
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.
Pull Request Overview
This PR adds functionality to allow the action to be skipped when the PR is labeled with "no-issue". It introduces a new utility function (skipLinkedIssuesCheck), refactors the main action flow accordingly, and adds tests and mocks to verify the behavior.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/action.test.js | Added tests for verifying the "no-issue" label functionality and logging |
mocks/@actions/github.js | Updated mock to include a labels structure based on the PR's "no-issue" flag |
src/util.js | Added the skipLinkedIssuesCheck function and extended getLinkedIssues to query labels |
src/action.js | Refactored to use the new skipLinkedIssuesCheck and adjust the flow accordingly |
Comments suppressed due to low confidence (1)
src/action.test.js:159
- [nitpick] Consider returning a boolean value (true) instead of a string to more accurately reflect the expected input type, which could help avoid potential issues if the code later strictly expects a boolean.
core.getBooleanInput.mockReturnValue("true");
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.
Looks good! Thank you for the contribution @gstokkink
One thing actually @gstokkink, do you mind updating the README to reflect this new feature? |
@agubler something like that? |
thanks @gstokkink, one small suggestion to correct the formatting in the table |
Co-authored-by: Anthony Gubler <agubler@gmail.com>
@agubler updated |
@simoneb updated |
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.
LGTM, thanks for the contribution!
@gstokkink one small linting issue to fix and then we're good to merge |
@simoneb d'oh, fixed. |
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.
Pull Request Overview
This PR introduces functionality to bypass the linked issues check when a pull request is labeled with "no-issue". Key changes include adding conditional label logic in the mocks, updating tests to verify the new behavior, refactoring the action logic to skip checks when applicable, and updating documentation to reflect these changes.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
mocks/@actions/github.js | Added conditional labels to simulate a PR with a "no-issue" label. |
src/action.test.js | Adjusted tests to verify that when the "no-issue" label is present, the check is skipped and comments are deleted; corrected casing in debug messages. |
src/util.js | Introduced the skipLinkedIssuesCheck() function and updated the GraphQL query to include labels. |
src/action.js | Reordered logic to perform the skip check before processing linked issues. |
README.md | Updated documentation to describe the behavior when a "no-issue" label is applied. |
Comments suppressed due to low confidence (2)
mocks/@actions/github.js:61
- [nitpick] Consider extracting the literal "no-issue" into a shared constant to ensure consistency across mocks and production code.
{ name: "no-issue", },
src/util.js:153
- [nitpick] Using a shared constant for the "no-issue" label can help prevent discrepancies and ease future updates if the label changes.
return labels.includes("no-issue");
Thought this might be useful upstream as well.