Skip to content

Commit 85b0667

Browse files
authored
Aktualisieren von mod-update.yml
1 parent 1579643 commit 85b0667

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

.github/workflows/mod-update.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,50 @@
1-
name: Update Hugo dependencies
1+
name: Update Hugo Dependencies
22
on:
33
workflow_dispatch:
44
schedule:
5-
- cron: '0 3 * * *' # run daily at 03:00 AM
5+
- cron: '0 3 * * *' # Run daily at 03:00 AM
66

77
permissions:
88
contents: write
99
pull-requests: write
1010

1111
jobs:
12-
update-mod:
12+
update-hugo-modules:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16+
# Step 1: Checkout repository
1617
- name: Checkout repository
1718
uses: actions/checkout@v4
1819

19-
- name: Setup Node.js
20+
# Step 2: Setup Node.js
21+
- name: Setup Node.js environment
2022
uses: actions/setup-node@v4
2123
with:
2224
node-version: lts/*
2325
cache: 'npm'
2426
cache-dependency-path: '**/package-lock.json'
2527

26-
- name: Perform clean install of npm
28+
# Step 3: Install dependencies
29+
- name: Install npm dependencies
2730
run: npm ci
2831

32+
# Step 4: Update Hugo module dependencies
2933
- name: Update Hugo module dependencies
30-
id: mod-updates
34+
id: update-modules
3135
run: |
3236
MOD_OUTPUT=$(npm run mod:update 2>&1)
3337
echo "$MOD_OUTPUT"
3438
MOD_UPDATES=$(echo "$MOD_OUTPUT" | grep '^go: upgraded' | sed 's/go: / - /' | sort -u)
3539
echo 'MOD_UPDATES<<EOF' >> $GITHUB_OUTPUT
36-
echo "$MOD_UPDATES" >> "$GITHUB_OUTPUT"
40+
echo "$MOD_UPDATES" >> $GITHUB_OUTPUT
3741
echo 'EOF' >> $GITHUB_OUTPUT
3842
43+
# Step 5: Create a Pull Request for changes
3944
- name: Create Pull Request
40-
uses: gethinode/create-pull-request@v6
45+
uses: peter-evans/create-pull-request@v7
4146
with:
42-
token: ${{ secrets.HUGO_MOD_PR }}
47+
token: ${{ secrets.GITHUB_TOKEN }}
4348
commit-message: 'fix: update Hugo module dependencies'
4449
committer: GitHub <noreply@github.com>
4550
branch: hugo-mod-dependencies
@@ -48,14 +53,12 @@ jobs:
4853
body: |
4954
This PR is auto-generated by [create-pull-request][1].
5055
51-
Changes to go.mod:
56+
**Changes to Hugo modules:**
5257
53-
${{ steps.mod-updates.outputs.MOD_UPDATES }}
58+
${{ steps.update-modules.outputs.MOD_UPDATES }}
5459
5560
[1]: https://github.com/peter-evans/create-pull-request
5661
labels: dependencies
57-
# Note: remove **/go.mod and **/go.sum if your repository does not have an exampleSite
58-
# or any other subfolder that uses Hugo modules
5962
add-paths: |
6063
go.mod
6164
go.sum

0 commit comments

Comments
 (0)