Repository navigation
feat(ci): fail a PR whose close keywords sit in prose (#672) #786
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| name: Close keywords | ||
|
|
||
| # GitHub closes an issue on merge for a close keyword ANYWHERE in a PR body or | ||
| # a commit that lands on main — mid-sentence, after a colon, across a line | ||
| # break. This repository writes `Refs #N` on purpose for work that closes on a | ||
| # physical act or a deploy, and eight issues were shut by prose anyway; three | ||
| # sat closed with the work undone until a full pass found them (#672). | ||
| # scripts/check_close_keywords.py holds the rules and the phrases that did it. | ||
| # | ||
| # Checking closingIssuesReferences by hand after opening the PR was the | ||
| # mitigation before this, and #780 merged past it the day before this landed. | ||
| # | ||
| # A SEPARATE WORKFLOW, NOT A JOB IN ci.yml | ||
| # | ||
| # The body is what is checked, so the check has to re-run when the body is | ||
| # edited. `edited` on ci.yml would re-run lint, validate and the hardened boots | ||
| # on every wording fix, and its cancel-in-progress concurrency would kill a | ||
| # validate run half way through its six minutes of registry traffic to do it. | ||
| # The same reasoning as digests.yml: one question, its own trigger. | ||
| # | ||
| # The list of issues the merge will close goes to the job summary whether the | ||
| # check passes or fails, so it is one click from the PR before merge. | ||
| # | ||
| # The one thing these triggers cannot see: an issue linked in the PR's sidebar. | ||
| # Linking emits no pull_request event, so a link added after the last run | ||
| # leaves this check green and stale. Nothing here is refreshed by it, and | ||
| # without a merge queue nothing runs at merge time, so the gap is stated | ||
| # rather than closed: re-run this job before merging if the sidebar changed. | ||
| on: | ||
| pull_request: | ||
| types: [opened, edited, reopened, synchronize] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| # closingIssuesReferences and the commit list, read over GraphQL. | ||
| pull-requests: read | ||
| # The titles of the issues the merge will close, for the summary. | ||
| issues: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| close-keywords: | ||
| name: No close keyword in prose | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| # Through env, not ${{ }} in the script: the number is an integer, but | ||
| # nothing from the event is interpolated into a shell line here, so that | ||
| # stays true when someone adds the title or the body later. | ||
| - name: Check the PR body, title and commits | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| run: python3 scripts/check_close_keywords.py --pr "$PR_NUMBER" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.