Skip to content

feat(template): enforce linked issues on pull requests - #31

Merged
hasansezertasan merged 1 commit into
mainfrom
feat/enforce-linked-issues
Jun 24, 2026
Merged

feat(template): enforce linked issues on pull requests#31
hasansezertasan merged 1 commit into
mainfrom
feat/enforce-linked-issues

Conversation

@hasansezertasan

Copy link
Copy Markdown
Owner

Summary

Adds an always-on check-linked-issues.yml workflow to generated projects using nearform-actions/github-action-check-linked-issues. It fails any PR that has no linked issue — the GitHub Development relationship created by a Closes #N keyword in the PR body.

Why this action over alternatives:

  • It validates the real closingIssuesReferences GraphQL relationship (the Development panel), not just a regex match on body text — so it can't be fooled by a stray #48 mention.
  • Actively maintained (v1.8.3, Jun 2025), SHA-pinned (@7140e2e… # v1.8.3) so Renovate's native github-actions manager keeps it current.
  • A no-issue label bypasses the check for PRs that genuinely need none.

kentaro-m/task-completed-checker-action was considered and rejected — it only checks markdown checkboxes, not issue links, and is unmaintained (last release 2023).

Changes

  • New template/.github/workflows/check-linked-issues.yml (plain .yml, no Jinja vars — mirrors check-pr-title.yml; pull_request_target with issues: 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 api PUT) requiring both Validate PR title and Verify linked issue on main.

Testing

  • example/ regenerated from .example-input.yml.
  • tox -e styleOK (all 15 commands, incl. actionlint over the new workflow and typos over the new docs).

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`.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @hasansezertasan, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@hasansezertasan
hasansezertasan merged commit b86842c into main Jun 24, 2026
5 checks passed
@hasansezertasan
hasansezertasan deleted the feat/enforce-linked-issues branch June 24, 2026 16:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant