1name: VHS GIFs23on:4 release:5 types: [published]6 workflow_dispatch:7 push:8 branches: [main]9 paths:10 - "justfile"11 - "vhs/*.tape"1213permissions:14 contents: write15 pull-requests: write1617jobs:18 generate-gifs:19 name: Generate GIFs20 runs-on: ubuntu-latest21 steps:22 - uses: actions/checkout@v42324 - uses: actions/setup-go@v525 with:26 go-version: "1.24"2728 - name: Install just29 uses: extractions/setup-just@v23031 - name: Install VHS and dependencies32 run: |33 sudo apt-get update34 sudo apt-get install -y ffmpeg ttyd35 go install github.com/charmbracelet/vhs@latest3637 - name: Generate GIFs38 run: just vhs3940 - name: Create PR with updated GIFs41 run: |42 git config user.name "github-actions[bot]"43 git config user.email "github-actions[bot]@users.noreply.github.com"44 git add vhs/*.gif45 if git diff --cached --quiet; then46 echo "No GIF changes to commit"47 exit 048 fi49 branch="chore/regenerate-vhs-gifs"50 git checkout -b "$branch"51 git commit -m "chore: regenerate VHS GIFs"52 git push --force origin "$branch"53 if gh pr list --head "$branch" --state open --json number --jq '.[0].number' | grep -q .; then54 echo "PR already exists"55 else56 gh pr create \57 --title "chore: regenerate VHS GIFs" \58 --body "Auto-generated by the VHS workflow. Merge to update game preview GIFs." \59 --head "$branch" \60 --base main61 fi62 env:63 GH_TOKEN: ${{ github.token }}