Files
ghostty/.github/workflows/vouch.yml
Mitchell Hashimoto a4d0d5c182 moving stuff around
2026-02-15 06:53:29 -08:00

57 lines
1.8 KiB
YAML

name: Vouch
on:
issue_comment:
types: [created]
jobs:
vouch:
if: ${{ !github.event.issue.pull_request }}
runs-on: namespace-profile-ghostty-xsm
permissions:
contents: write
issues: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Vouch for contributor
id: update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
status=$(nix develop -c nu .github/vouch/vouch.nu approve-by-issue \
-R ${{ github.repository }} \
${{ github.event.issue.number }} \
${{ github.event.comment.id }} \
--dry-run=false \
| tail -1)
echo "status=$status" >> "$GITHUB_OUTPUT"
- name: Commit and push
if: steps.update.outputs.status == 'added'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .github/VOUCHED
git diff --staged --quiet || git commit -m "chore: vouch for contributor ${{ github.event.issue.user.login }}"
git push
- name: Comment on issue
if: steps.update.outputs.status == 'added'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue comment ${{ github.event.issue.number }} \
--body "@${{ github.event.issue.user.login }} has been vouched for and added to the contributors list. You can now submit PRs. Thanks for contributing!"