Skip to content

Commit a1ef07e

Browse files
author
Splitter
committed
feat: harden block inputs (batch 1)
1 parent 780f366 commit a1ef07e

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

.github/workflows/upgrade.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Upgrade HugoBlox
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_type:
7+
description: 'Upgrade to version'
8+
required: true
9+
default: 'stable'
10+
type: choice
11+
options:
12+
- stable
13+
- canary
14+
schedule:
15+
# Run at 05:00 on Monday
16+
- cron: '0 5 * * 1'
17+
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
22+
jobs:
23+
upgrade:
24+
name: Upgrade
25+
if: github.repository_owner != 'HugoBlox'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '20'
37+
38+
- name: Setup Go
39+
uses: actions/setup-go@v5
40+
with:
41+
go-version: '1.21'
42+
43+
- name: Setup Hugo
44+
uses: peaceiris/actions-hugo@v3
45+
with:
46+
hugo-version: 'latest'
47+
extended: true
48+
49+
- name: Run Upgrade CLI
50+
env:
51+
# Use manual input or default to stable for scheduled runs
52+
VERSION_TYPE: ${{ inputs.version_type || 'stable' }}
53+
run: |
54+
FLAGS="--yes --ci"
55+
56+
if [ "$VERSION_TYPE" == "canary" ]; then
57+
FLAGS="$FLAGS --canary"
58+
fi
59+
60+
echo "Running upgrade with flags: $FLAGS"
61+
npx --yes hugoblox@latest upgrade $FLAGS
62+
63+
- name: Create Pull Request
64+
uses: peter-evans/create-pull-request@v6
65+
with:
66+
token: ${{ secrets.GITHUB_TOKEN }}
67+
commit-message: "chore(deps): upgrade hugoblox modules"
68+
title: "⬆️ Upgrade HugoBlox Modules"
69+
body: |
70+
This PR upgrades the [HugoBlox](https://hugoblox.com) modules to the latest version.
71+
72+
**Changes:**
73+
- Updated Hugo Modules (go.mod/go.sum)
74+
- Applied automatic migrations (if any)
75+
76+
**Verification:**
77+
- [ ] Check the Deploy Preview to ensure everything looks correct.
78+
- [ ] Merge this PR to apply the updates.
79+
branch: "chore/upgrade-hugoblox"
80+
delete-branch: true
81+
base: main
82+
labels: |
83+
dependencies
84+
automated-pr

0 commit comments

Comments
 (0)