1
0
mirror of https://github.com/PrivSec-dev/privsec.dev synced 2025-02-20 18:31:35 -05:00

Add workflow

It will update HUGO_VERSION variable in netlify.toml

Signed-off-by: samsepi0l <contact@simpleprivacy.fr>
This commit is contained in:
samsepi0l 2023-03-24 23:11:29 +01:00 committed by GitHub
parent 959fd033f8
commit 813cb65cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,25 @@
name: Update Hugo Version
on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight
workflow_dispatch: # Allow manual triggering
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get latest Hugo version
id: hugo-version
run: echo "::set-output name=version::$(curl --silent https://api.github.com/repos/gohugoio/hugo/releases/latest | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')"
- name: Update netlify.toml
run: sed -i "s/HUGO_VERSION = \".*\"/HUGO_VERSION = \"${{ steps.hugo-version.outputs.version }}\"/" netlify.toml
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Update Hugo version'