Files
blowfish/.github/workflows/hugo-version-update.yml
T
Nuno CoraçãoandClaude Fable 5 0da79b9888 ⚙️ Prepare v3 release: module path, version window, 3.0.0
Bump the Hugo module path to /v3, adopt a rolling latest-4 Hugo
version window (bot keeps it sliding), document new opt-in params,
and set package version to 3.0.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 20:19:02 +01:00

61 lines
1.9 KiB
YAML

name: Update Hugo version
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
jobs:
updateBlowfish:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v7
with:
ref: main
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Fetch release version
id: fetch-release
run: |
curl -sL https://api.github.com/repos/gohugoio/hugo/releases/latest | \
jq -r ".tag_name" > release-versions/hugo-latest.txt
- name: Check for modified files
id: git-check
run:
echo ::set-output name=modified::$([ -z "`git status --porcelain`" ]
&& echo "false" || echo "true")
- name: Update config.toml
id: update-config
if: steps.git-check.outputs.modified == 'true'
run: |
cat release-versions/hugo-latest.txt | \
while read version; do \
v="${version#v}"; \
minor="$(echo "$v" | cut -d. -f2)"; \
min_minor="$((minor - 3))"; \
sed -i'' -E "s/(max = \")[0-9]+\.[0-9]+\.[0-9]+(\")/\1${v}\2/g" config.toml; \
sed -i'' -E "s/(min = \")[0-9]+\.[0-9]+\.[0-9]+(\")/\10.${min_minor}.0\2/g" config.toml; \
done
- name: Create Pull Request
if: steps.git-check.outputs.modified == 'true'
uses: peter-evans/create-pull-request@v8
with:
commit-message: Update Hugo supported version
title: ⚙️ Update Hugo supported version
body: |
Updates [Hugo][1] support
Auto-generated by [create-pull-request][2]
[1]: https://github.com/gohugoio/hugo
[2]: https://github.com/peter-evans/create-pull-request
labels: dependencies, automated pr
branch: hugo-new-version
base: main