isscope/.github/workflows/vouch.yml
2026-05-12 14:47:13 +05:30

93 lines
2.9 KiB
YAML

name: Vouch
on:
issues:
types: [opened, reopened]
pull_request_target:
types: [opened, reopened, synchronize]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
check-issue:
if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened')
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: mitchellh/vouch/action/check-issue@v1
with:
issue-number: ${{ github.event.issue.number }}
auto-close: true
require-vouch: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
check-pr:
if: github.event_name == 'pull_request_target' && (github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize')
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: mitchellh/vouch/action/check-pr@v1
with:
pr-number: ${{ github.event.pull_request.number }}
auto-close: true
require-vouch: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
manage-by-comment:
if: github.event_name == 'issue_comment' && github.event.action == 'created'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Issue/PR Number
id: get-number
run: |
if [ "${{ github.event.issue.pull_request }}" != "" ]; then
echo "number=${{ github.event.issue.number }}" >> $GITHUB_OUTPUT
echo "is_pr=true" >> $GITHUB_OUTPUT
else
echo "number=${{ github.event.issue.number }}" >> $GITHUB_OUTPUT
echo "is_pr=false" >> $GITHUB_OUTPUT
fi
- uses: mitchellh/vouch/action/manage-by-issue@v1
with:
issue-id: ${{ steps.get-number.outputs.number }}
comment-id: ${{ github.event.comment.id }}
pull-request: true
merge-immediately: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
manage-by-pr-review-comment:
if: github.event_name == 'pull_request_review_comment' && github.event.action == 'created'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: mitchellh/vouch/action/manage-by-issue@v1
with:
issue-id: ${{ github.event.pull_request.number }}
comment-id: ${{ github.event.comment.id }}
pull-request: true
merge-immediately: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}