Skip to content

Commit

Permalink
fix: create git branch in workflow (gokarna-theme#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored Oct 31, 2024
1 parent 55162d7 commit bea2b13
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/screenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
run-docker:
update-screenshots:
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand All @@ -19,13 +19,17 @@ jobs:
- name: Run screenshotter container
run: docker run -v $(pwd):/app ghcr.io/gokarna-theme/gokarna-hugo/screenshotter

- name: See diffs
- name: Create PR
run: |
if [[ -z $(git status images --porcelain) ]]; then
echo "No changes found"
exit 0
fi
git checkout -b auto-update-screenshots
git add images/
git commit -m 'chore: update screenshots'
git push origin auto-update-screenshots -f
gh pr create -B main -H auto-update-screenshots --title 'chore: update screenshots' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bea2b13

Please sign in to comment.