.github/workflows/pages.yml: only commit on main

Don't automatically commit changes to the Hugo site content unless
we are on the main branch. This is unnecessary and makes it tricky
to work on feature branches or pull requests.
This commit is contained in:
Alan Orth 2022-01-06 12:49:46 +02:00
parent 7363e8d70d
commit d96be74836
1 changed files with 3 additions and 0 deletions

View File

@ -31,6 +31,9 @@ jobs:
working-directory: site
- name: Commit Hugo content
uses: stefanzweifel/git-auto-commit-action@v4
# Only run if we are on the main branch. We don't want to create extra
# commits on feature branches or pull requests.
if: ${{ github.ref_name == 'main' }}
with:
commit_message: Automated commit with site updates
# Only commit if there are changes to the site.