Skip to content

.github: gate PRs via mitchellh/vouch - #3388

Open
juanfont wants to merge 2 commits into
mainfrom
vouch
Open

.github: gate PRs via mitchellh/vouch#3388
juanfont wants to merge 2 commits into
mainfrom
vouch

Conversation

@juanfont

Copy link
Copy Markdown
Owner

PRs keep arriving without the prior discussion CONTRIBUTING.md asks
for. We are not able to review or triage PRs fast enough, specially now that everyone has super human code generation capabilities.

Adopt mitchellh/vouch to
auto-close PRs from authors not on .github/VOUCHED.td. Issues stay
open to everyone — the close message points contributors back at
CONTRIBUTING.md to start that discussion.

Less aggressive than ghostty, which gates issues too.

Seed list is past PR contributors with merged code plus authors of
detailed issues; bots and CODEOWNERS are auto-vouched. Anyone with an
open PR that hasn't been through review yet was left off — !vouch
later if it lands.

!vouch @user / !denounce @user / !unvouch @user on any issue or PR
comment from a maintainer manages the list. Weekly cron resyncs
CODEOWNERS.

Workflows need a GitHub App with Contents/Issues/PRs write installed on
the repo, plus VOUCH_APP_ID and VOUCH_APP_PRIVATE_KEY secrets. Until
those exist nothing is gated (fail-open).

Generated with the help of an AI assistant

Comment on lines +13 to +36
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
id: app-token
with:
app-id: ${{ secrets.VOUCH_APP_ID }}
private-key: ${{ secrets.VOUCH_APP_PRIVATE_KEY }}

- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
token: ${{ steps.app-token.outputs.token }}

- uses: mitchellh/vouch/action/manage-by-issue@d66fa29a64600490892131ad87597c30c91fcac4 # v1.5.0
with:
repo: ${{ github.repository }}
issue-id: ${{ github.event.issue.number }}
comment-id: ${{ github.event.comment.id }}
vouch-keyword: "!vouch"
denounce-keyword: "!denounce"
unvouch-keyword: "!unvouch"
pull-request: "true"
merge-immediately: "true"
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} No newline at end of file
Comment on lines +14 to +32
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
id: app-token
with:
app-id: ${{ secrets.VOUCH_APP_ID }}
private-key: ${{ secrets.VOUCH_APP_PRIVATE_KEY }}

- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
token: ${{ steps.app-token.outputs.token }}

- uses: mitchellh/vouch/action/sync-codeowners@d66fa29a64600490892131ad87597c30c91fcac4 # v1.5.0
with:
repo: ${{ github.repository }}
pull-request: "true"
merge-immediately: "true"
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} No newline at end of file
auto-close: true
template-file: .github/pr-unvouched-message
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need to run prettier formatter on all files.

Comment on lines +14 to +18
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
id: app-token
with:
app-id: ${{ secrets.VOUCH_APP_ID }}
private-key: ${{ secrets.VOUCH_APP_PRIVATE_KEY }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This step isnt needed, see secrets comment

auto-close: true
template-file: .github/pr-unvouched-message
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This already exists GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}, I think that will be correct. Needs to be on all

Comment thread .github/VOUCHED.td
vsychov
yaneony
yaroslavkasatikov
Zottelchen No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Zottelchen
Zottelchen
iSerganov
arpitjain099
fredrikekre

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.

3 participants