Skip to main content

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

View workflow →

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 }}
InputRequiredDefaultDescription
typesNofeat,fix,...Allowed commit types
requireScopeNofalseRequire scope in parentheses
subjectPatternNoRegex for the subject line
validateSingleCommitNofalseRequire single commit on PRs
checkLabelsNofalseValidate PR labels
note

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.

View workflow →

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 }}
InputRequiredDescription
assigneesYesComma-separated GitHub usernames to assign
reviewersNoComma-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.

View workflow →

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 }}
InputRequiredDefaultDescription
tfcheckNotrueWait for Terraform checks
tfchecks_azureNofalseWait for Azure Terraform checks
azure_cloudNofalseEnable 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.

View workflow →

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 }}
tip

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.

View workflow →

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 }}
InputRequiredDefaultDescription
review_promptYesInstruction prompt for the AI
gemini_modelNogemini-1.5-proGemini model to use
github_tokenNoToken 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.

View workflow →

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 }}
InputRequiredDefaultDescription
days-before-issue-staleNo60Days before marking an issue stale
days-before-pr-staleNo30Days before marking a PR stale
days-before-issue-closeNo14Days after stale before closing issue
days-before-pr-closeNo7Days after stale before closing PR

pr-lock

Automatically lock closed issues, PRs, and discussions after inactivity — prevents further comments on old resolved items.

View workflow →

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 }}
InputRequiredDefaultDescription
issue-inactive-daysNo365Days after close before locking issue
pr-inactive-daysNo90Days after close before locking PR
discussion-inactive-daysNo365Days after close before locking discussion