feat(template): enforce linked issues on pull requests - #31
Conversation
Add an always-on `check-linked-issues.yml` workflow using nearform-actions/github-action-check-linked-issues, which fails a PR that has no linked issue (the GitHub Development relationship created by a `Closes #N` keyword in the PR body). It validates the real `closingIssuesReferences` relationship rather than matching body text, and a `no-issue` label bypasses the check. Document the workflow in CLAUDE.md and README.md, add an issue-linking requirement to the generated CONTRIBUTING.md, and include a one-time branch-protection setup command that requires both PR checks on `main`.
There was a problem hiding this comment.
Sorry @hasansezertasan, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d61a547f15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| name: Check Linked Issues | ||
| on: | ||
| pull_request_target: | ||
| types: [opened, edited, reopened, synchronize] |
There was a problem hiding this comment.
Re-run the linked-issue check on label changes
The bypass is controlled by the no-issue label, but this workflow only runs for opened/edited/reopened/synchronize events. When Verify linked issue is required, adding no-issue after a failed run leaves the required check failed until some unrelated edit or manual rerun, and removing the label after a skipped passing run leaves a stale success that can still satisfy branch protection; include labeled/unlabeled so the check reflects the current label state.
Useful? React with 👍 / 👎.
Summary
Adds an always-on
check-linked-issues.ymlworkflow to generated projects usingnearform-actions/github-action-check-linked-issues. It fails any PR that has no linked issue — the GitHub Development relationship created by aCloses #Nkeyword in the PR body.Why this action over alternatives:
closingIssuesReferencesGraphQL relationship (the Development panel), not just a regex match on body text — so it can't be fooled by a stray#48mention.@7140e2e… # v1.8.3) so Renovate's native github-actions manager keeps it current.no-issuelabel bypasses the check for PRs that genuinely need none.kentaro-m/task-completed-checker-actionwas considered and rejected — it only checks markdown checkboxes, not issue links, and is unmaintained (last release 2023).Changes
template/.github/workflows/check-linked-issues.yml(plain.yml, no Jinja vars — mirrorscheck-pr-title.yml;pull_request_targetwithissues: read+pull-requests: write).CLAUDE.md— documents the workflow as CI/CD item refactor(web): update project template and dependencies #4.README.md— adds "linked-issue enforcement" to the automation list.template/CONTRIBUTING.md.jinja— issue-linking requirement in Pull Requests, plus a one-time branch-protection setup step (gh apiPUT) requiring bothValidate PR titleandVerify linked issueonmain.Testing
example/regenerated from.example-input.yml.tox -e style→ OK (all 15 commands, incl.actionlintover the new workflow andtyposover the new docs).