From d96be748362d0a73b243021dc7464cc965702f81 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Thu, 6 Jan 2022 12:49:46 +0200 Subject: [PATCH] .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. --- .github/workflows/pages.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index df18b85e..de2474fa 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -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.