Pull Request Automation
Seven workflows automate common pull request tasks: enforcing commit standards, assigning reviewers, running AI-powered code reviews, detecting secrets, and keeping issue trackers clean.
pr-checks
Validate PR title format and commit messages against semantic commit standards — ensures all PRs follow a consistent format (e.g., feat: add login page, fix(auth): handle token expiry).
When to use: On every pull request to enforce commit message standards across your team.
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
pr-checks:
uses: clouddrove/github-shared-workflows/.github/workflows/pr-checks.yml@master
with:
types: >-
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert
requireScope: false
validateSingleCommit: false
checkLabels: false
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
| Input | Required | Default | Description |
|---|---|---|---|
types | No | feat,fix,... | Allowed commit types |
requireScope | No | false | Require scope in parentheses |
subjectPattern | No | — | Regex for the subject line |
validateSingleCommit | No | false | Require single commit on PRs |
checkLabels | No | false | Validate PR labels |
There is also a pr_checks.yml (underscore) that serves as an alias for backwards compatibility.
pr-auto-assignee
Automatically assign reviewers and assignees to pull requests — triggers when a PR is opened or reopened and assigns the specified GitHub users.
on:
pull_request:
types: [opened, reopened]
jobs:
assign:
uses: clouddrove/github-shared-workflows/.github/workflows/pr-auto-assignee.yml@master
with:
assignees: alice,bob # required: GitHub usernames
reviewers: charlie,diana
secrets:
GITHUB: ${{ secrets.GITHUB_TOKEN }}
| Input | Required | Description |
|---|---|---|
assignees | Yes | Comma-separated GitHub usernames to assign |
reviewers | No | Comma-separated GitHub usernames to request review from |
pr-auto-merge
Auto-approve and merge Dependabot PRs after passing Terraform checks — reduces toil from dependency update PRs by automatically merging them once CI passes.
on:
pull_request:
types: [opened, synchronize]
jobs:
auto-merge:
uses: clouddrove/github-shared-workflows/.github/workflows/pr-auto-merge.yml@master
with:
tfcheck: true # wait for Terraform checks to pass
azure_cloud: false
secrets:
GITHUB: ${{ secrets.GITHUB_TOKEN }}
| Input | Required | Default | Description |
|---|---|---|---|
tfcheck | No | true | Wait for Terraform checks |
tfchecks_azure | No | false | Wait for Azure Terraform checks |
azure_cloud | No | false | Enable Azure cloud checks |
pr-claude-review
Automated code review using Claude AI — posts a detailed code review comment on the pull request with suggestions, potential bugs, and security observations.
When to use: On pull requests when you want AI-assisted review in addition to human review.
on:
pull_request:
types: [opened, synchronize]
jobs:
claude-review:
uses: clouddrove/github-shared-workflows/.github/workflows/pr-claude-review.yml@master
with:
branch: main # optional: base branch to compare against
secrets:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
Get an Anthropic API key at console.anthropic.com and add it as a repository secret named ANTHROPIC_API_KEY.
pr-gemini-review
Automated code review using Google Gemini AI — an alternative to Claude review using Google's Gemini model.
on:
pull_request:
types: [opened, synchronize]
jobs:
gemini-review:
uses: clouddrove/github-shared-workflows/.github/workflows/pr-gemini-review.yml@master
with:
review_prompt: "Review this code for security issues and performance problems."
gemini_model: gemini-1.5-pro
github_token: ${{ secrets.GITHUB_TOKEN }}
secrets:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
| Input | Required | Default | Description |
|---|---|---|---|
review_prompt | Yes | — | Instruction prompt for the AI |
gemini_model | No | gemini-1.5-pro | Gemini model to use |
github_token | No | — | Token for posting PR comments |
pr-stale
Mark and close inactive issues and pull requests — adds a stale label after a configurable period of inactivity, then closes them if no further activity occurs.
When to use: Schedule this to run daily to keep your issue tracker clean.
on:
schedule:
- cron: '0 0 * * *' # daily at midnight UTC
jobs:
stale:
uses: clouddrove/github-shared-workflows/.github/workflows/pr-stale.yml@master
with:
days-before-issue-stale: 60
days-before-pr-stale: 30
days-before-issue-close: 14
days-before-pr-close: 7
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
| Input | Required | Default | Description |
|---|---|---|---|
days-before-issue-stale | No | 60 | Days before marking an issue stale |
days-before-pr-stale | No | 30 | Days before marking a PR stale |
days-before-issue-close | No | 14 | Days after stale before closing issue |
days-before-pr-close | No | 7 | Days after stale before closing PR |
pr-lock
Automatically lock closed issues, PRs, and discussions after inactivity — prevents further comments on old resolved items.
on:
schedule:
- cron: '0 0 * * *'
jobs:
lock:
uses: clouddrove/github-shared-workflows/.github/workflows/pr-lock.yml@master
with:
issue-inactive-days: 365
pr-inactive-days: 90
discussion-inactive-days: 365
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
| Input | Required | Default | Description |
|---|---|---|---|
issue-inactive-days | No | 365 | Days after close before locking issue |
pr-inactive-days | No | 90 | Days after close before locking PR |
discussion-inactive-days | No | 365 | Days after close before locking discussion |