-
-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1303 from nunocoracao/1280-automatically-bump-hug…
…o-support-version-when-theres-a-new-release ⚙️ new action for auto update
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
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@v4 | ||
with: | ||
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 sed -i '' -E "s/(max = \")[0-9]+\.[0-9]+\.[0-9]+(\")/\1${version#v}\2/g" config.toml | | ||
release_tag=$(cat release-versions/hugo-latest.txt) | \ | ||
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT | ||
- name: Create Pull Request | ||
if: steps.git-check.outputs.modified == 'true' | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
commit-message: Update Hugo supported version to ${{ steps.update-config.outputs.release_tag }} | ||
title: Update Hugo supported version to ${{ steps.update-config.outputs.release_tag }} | ||
body: | | ||
Updates [Hugo][1] support to ${{ steps.update-config.outputs.release_tag }} | ||
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: dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.123.7 |