Cookbook
February 17, 2026 · View on GitHub
Common tasks and step-by-step guides for setting up and using Vouch. The README covers the basics; this document walks through real-world scenarios in more detail.
Integrating with Branch Protection and Rulesets
This is only required if you have branch protection or ruleset merge requirements. If you do not, you do not need to setup a GitHub app.
The default GITHUB_TOKEN provided by GitHub Actions cannot be added
to a branch protection or ruleset bypass list. This means workflows
that push commits or merge PRs (like the manage-by-issue and
manage-by-discussion actions) will fail if your default branch has
merge requirements such as required reviews or status checks.
A private GitHub App gives you a named identity that can be added to the bypass list and works across repositories.
Use a GitHub App when you need any of the following:
- Bypassing branch protection or ruleset merge requirements for automated VOUCHED file commits.
- The
manage-by-issueormanage-by-discussionactions withpull-request: true, especially withmerge-immediately: true. - Cross-repo lookups via
vouched-managers-repo.
1. Create the GitHub App
- Go to Settings → Developer settings → GitHub Apps → New GitHub App (for an org, go to Organization Settings → Developer settings → GitHub Apps).
- Fill in the basics:
- Name: something like
myorg-vouch(must be globally unique). - Homepage URL: your repo URL or
https://github.com/mitchellh/vouch. - Webhook: uncheck Active (you don't need webhook delivery; GitHub Actions triggers the workflows).
- Name: something like
- Set permissions (Repository permissions only):
- Contents: Read & write (commit VOUCHED file changes).
- Issues: Read & write (close issues, post comments).
- Pull requests: Read & write (create/close PRs, post comments).
- Discussions: Read & write (only if using
manage-by-discussion). - Metadata: Read-only (always required).
- Under Where can this GitHub App be installed?, choose Only on this account.
- Click Create GitHub App.
2. Generate a Private Key
- On the app's settings page, scroll to Private keys.
- Click Generate a private key. A
.pemfile downloads. - Keep this file safe — you'll store it as a repository secret.
3. Install the App
- From the app's settings page, click Install App in the sidebar.
- Choose your account or organization.
- Select Only select repositories and pick the repo(s) where you use Vouch.
- Click Install.
4. Store Secrets
In each repository that uses the app:
- Go to Settings → Secrets and variables → Actions.
- Add two repository secrets:
VOUCH_ID— the App ID shown on the app's General page.VOUCH_PRIVATE_KEY— the full contents of the.pemfile.
5. Use the App Token in Workflows
Use a well-known action to mint a short-lived installation token at the
start of each job, then pass it as GITHUB_TOKEN:
name: Manage by Issue
on:
issue_comment:
types: [created]
concurrency:
group: vouch-manage
cancel-in-progress: false
permissions: {}
jobs:
manage:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.VOUCH_ID }}
private-key: ${{ secrets.VOUCH_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- uses: mitchellh/vouch/action/manage-by-issue@v1
with:
issue-id: ${{ github.event.issue.number }}
comment-id: ${{ github.event.comment.id }}
pull-request: true
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
Key points:
permissions: {}— the workflow itself needs no permissions since the app token carries its own.- Pass the token to
actions/checkoutso that pushes and PR creation use the app identity instead of the default token. - The same pattern works for
check-pr,check-issue, andmanage-by-discussion— just swap the action and inputs.