-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Add workflow_dispatch support to PR Help Wanted check
#11179
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
ec6a6d6
61e9d94
8134fb3
302fb13
176718f
b16347c
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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,6 +2,12 @@ name: PR Help Wanted Check | |||||||||||
| on: | ||||||||||||
| pull_request_target: | ||||||||||||
| types: [opened] | ||||||||||||
| workflow_dispatch: | ||||||||||||
| inputs: | ||||||||||||
| pr_number: | ||||||||||||
| description: "Pull Request number to check" | ||||||||||||
| required: true | ||||||||||||
| type: string | ||||||||||||
|
|
||||||||||||
| permissions: | ||||||||||||
| contents: none | ||||||||||||
|
|
@@ -15,13 +21,27 @@ jobs: | |||||||||||
| - name: Checkout repository | ||||||||||||
| uses: actions/checkout@v4 | ||||||||||||
|
|
||||||||||||
| - name: Set PR variables for workflow_dispatch event | ||||||||||||
| id: pr-vars-dispatch | ||||||||||||
| if: github.event_name == 'workflow_dispatch' | ||||||||||||
| env: | ||||||||||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||
| PR_NUMBER: ${{ github.event.inputs.pr_number }} | ||||||||||||
|
Comment on lines
+27
to
+29
Contributor
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. nit: we could remove the
Suggested change
Member
Author
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. Sorry missed this with the auto merge 👀 I'll fix it |
||||||||||||
| run: | | ||||||||||||
| # We only need to construct the PR URL from the dispatch event input. | ||||||||||||
| echo "pr_url=https://github.com/cli/cli/pull/${PR_NUMBER}" >> $GITHUB_OUTPUT | ||||||||||||
|
|
||||||||||||
| - name: Check for issues without help-wanted label | ||||||||||||
| env: | ||||||||||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||
| # These variables are optionally used in the check-help-wanted.sh | ||||||||||||
| # script for additional checks; but they are not strictly necessary | ||||||||||||
| # for the script to run. This is why we are okay with them being | ||||||||||||
| # empty when the event is workflow_dispatch. | ||||||||||||
|
Comment on lines
+37
to
+40
Contributor
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. praise: thank you for including the commentary! I agree; for right now, they aren't necessary. If / when they are, we can revise to pull the information from the script itself. |
||||||||||||
| PR_AUTHOR: ${{ github.event.pull_request.user.login }} | ||||||||||||
| PR_AUTHOR_TYPE: ${{ github.event.pull_request.user.type }} | ||||||||||||
| PR_AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }} | ||||||||||||
| if: "!github.event.pull_request.draft" | ||||||||||||
| PR_URL: ${{ github.event.pull_request.html_url || steps.pr-vars-dispatch.outputs.pr_url }} | ||||||||||||
| run: | | ||||||||||||
| # Run the script to check for issues without help-wanted label | ||||||||||||
| bash .github/workflows/scripts/check-help-wanted.sh ${{ github.event.pull_request.html_url }} | ||||||||||||
| bash .github/workflows/scripts/check-help-wanted.sh "${PR_URL}" | ||||||||||||
Uh oh!
There was an error while loading. Please reload this page.