Skip to content

StacklokLabs/workflow-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

workflow-templates

A collection of reusable GitHub Actions workflows.

Available Workflows

Workflow Description
Check PR Issue Link Validates that pull request descriptions reference a valid GitHub issue

Check PR Issue Link

Ensures every pull request includes a closing keyword that links to a valid GitHub issue (e.g. Closes #42). When a valid link is missing, the workflow posts a warning comment and applies a needs-issue-link label. Once the PR description is corrected, the comment and label are automatically removed.

Supported keywords

All keywords are case-insensitive and may optionally include # before the issue number:

closes, close, fixes, fix, resolves, resolve

Behavior

Scenario Comment Label
No issue reference found Warning posted needs-issue-link added
Referenced numbers are invalid (not found or are PRs) Warning posted needs-issue-link added
Mix of valid and invalid references Heads-up posted Label removed
All references valid Previous warning removed Label removed

Usage

To call this workflow from another public repository, create a caller workflow in your repo:

# .github/workflows/check-pr-issue-link.yml
name: Check PR Issue Link
on:
  pull_request:
    types: [opened, edited, reopened, synchronize]

permissions:
  pull-requests: write
  issues: write

jobs:
  check:
    uses: StacklokLabs/workflow-templates/.github/workflows/check-pr-issue-link.yml@main

Prerequisites

  • The calling workflow must declare the required permissions. A reusable workflow cannot escalate beyond the permissions granted by its caller.
    • pull-requests: write
    • issues: write

About

A collection of workflow templates.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors