Skip to content

Commit

Permalink
ci: set bash as default shell, move committing changes to a different…
Browse files Browse the repository at this point in the history
… step [skip netlify]
  • Loading branch information
hugo-sid committed Mar 22, 2024
1 parent 7af83af commit 1b6b68f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/update-themes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ env:
jobs:
build:
runs-on: ubuntu-latest
# Use bash shell for all steps in the workflow
defaults:
run:
shell: bash
env:
HUGO_CACHEDIR: /tmp/hugo_cache
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -17,16 +21,22 @@ jobs:
with:
go-version: "^1.21.0"
- name: Update submodules
shell: bash
working-directory: ./cmd/hugothemesitebuilder
run: |
git config --global user.email "bep@users.noreply.github.com"
git config --global user.name "bep"
go install github.com/gohugoio/hugo@${{ env.HUGO_VERSION }}
go run main.go build -skipSiteBuild -cleanCache
cd build
hugo mod get
hugo mod tidy
- name: Commit & push changes
# Check the github.ref context to determine the current branch name. if it is 'refs/heads/main', then commit and push the changes.
# This allows experimenting/debugging GitHub actions without concerns about committing changes.
# For example, changes can be made to this workflow in a separate branch and a workflow run can be triggered manually (workflow_dispatch).
# For more information, see https://docs.github.com/en/actions/learn-github-actions/contexts
if: ${{ github.ref == 'refs/heads/main' }}
run: |
git config --global user.email "bep@users.noreply.github.com"
git config --global user.name "bep"
git add .
git commit -am "[Bot] Update themes"
git push --force-with-lease

0 comments on commit 1b6b68f

Please sign in to comment.