Skip to content

Commit 1cf2776

Browse files
stumbopamorosoCopilot
authored
Bs21 gha version updates (#330)
* Update Actions to latest version. Updates to actions to ensure they support node.js 24. GHA will default to this version of node.js in June 2026. This update will fix the following warning message: ``` Node.js 20 actions are deprecated. The following actions are running on Node.js 20 and may not work as expected: actions/cache/restore@v4, fjogeleit/http-request-action@v1. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. Please check if updated versions of these actions are available that support Node.js 24. To opt into Node.js 24 now, set the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true environment variable on the runner or in your workflow file. Once Node.js 24 becomes the default, you can temporarily opt out by setting ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ ``` * Replace GHA fjogeleit/http-request-action with curl http-request-action uses url.parse() which is being deprecated. Instead of waiting and hoping it is updated this replaces it and removes a dependency on node.js. * Fix reference, previous update changed this * CLeanup changes suggested by Copilot Fixes a couple minor issues: - TZ specified incorrectly - Add concurrency group to prevent parallel deployments - Cleaned up npm install and adding caching - Fix incorrect ID reference - Switch from v5.0.3 to v5 for cache actions to automatically get security updates. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Paolo Amoroso <paolo.amoroso@gmail.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Paolo Amoroso <paolo.amoroso@gmail.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Paolo Amoroso <paolo.amoroso@gmail.com> * Revert removal of FORCE_JAVASCRIPT_TO_NODE24 I want to keep this flag in the file until I'm ready to merge into main. As I make updates and validate them on my staging site I want to be sure the changes work on node.js 24. * Deploy-pages gha updated to v5 Adds suppport for Node.js 24 * Update configure-pages to v6.0.0 Support for node.js 24 * Update upload-pages-artifact to latest version * Remove temporary variable. All actions are updated and workflow is now compliant with NodeJS 24. * Cleanup based on 1 copilot suggestion. * Cleanup based on copilot suggestion Thought this change was made with the last commit, but evidently not. --------- Signed-off-by: Paolo Amoroso <paolo.amoroso@gmail.com> Co-authored-by: Paolo Amoroso <info@paoloamoroso.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent eb56071 commit 1cf2776

1 file changed

Lines changed: 34 additions & 22 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ permissions:
4040
pages: write
4141
id-token: write
4242

43+
concurrency:
44+
group: pages-${{ github.ref }}
45+
cancel-in-progress: true
46+
4347
defaults:
4448
run:
4549
shell: bash
@@ -57,27 +61,34 @@ jobs:
5761
#
5862
check:
5963
outputs:
60-
zoteroVersion: ${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }}
61-
cacheHit: ${{ steps.cache-zotero-bib.outputs.cache-hit }}
64+
zoteroVersion: ${{ steps.zoteroVersion.outputs.version }}
65+
cacheHit: ${{ steps.cache-zotero.outputs.cache-hit }}
6266

6367
runs-on: ubuntu-latest
6468
steps:
6569

6670
- name: Get Zotero Version Information
6771
id: zoteroVersion
68-
uses: fjogeleit/http-request-action@v1
69-
with:
70-
url: https://api.zotero.org/groups/2914042/items?format=versions
71-
method: GET
72-
72+
run: |
73+
set -euo pipefail
74+
VERSION=$(curl -fsSLI "https://api.zotero.org/groups/2914042/items?format=versions" \
75+
| { grep -i "last-modified-version" \
76+
| cut -d: -f2 \
77+
| tr -d $'\r ' || true; })
78+
if [[ -z "${VERSION:-}" ]]; then
79+
echo "Error: Failed to determine Zotero Last-Modified-Version from API response." >&2
80+
exit 1
81+
fi
82+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
83+
7384
- name: Cache Zotero Bibliography
7485
id: cache-zotero
75-
uses: actions/cache/restore@v4
86+
uses: actions/cache/restore@v5
7687
with:
7788
lookup-only: true
7889
path: |
7990
content/en/history/bibliography
80-
key: bib-${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }}
91+
key: bib-${{ steps.zoteroVersion.outputs.version }}
8192

8293
# ----------------------------------------------------------------------------
8394
# Validate that README.md references the correct Hugo version.
@@ -87,7 +98,7 @@ jobs:
8798
if: github.event_name == 'push' || github.event_name == 'pull_request'
8899
runs-on: ubuntu-latest
89100
steps:
90-
- uses: actions/checkout@v4
101+
- uses: actions/checkout@v6
91102

92103
- name: Check Hugo version consistency
93104
run: |
@@ -121,14 +132,14 @@ jobs:
121132
if: always() && (github.event_name == 'push' || github.event_name == 'pull_request' || needs.check.outputs.cacheHit != 'true') && (needs.validate-docs.result == 'success' || needs.validate-docs.result == 'skipped') && (needs.check.result == 'success' || needs.check.result == 'skipped')
122133
runs-on: ubuntu-latest
123134
steps:
124-
- uses: actions/checkout@v4
135+
- uses: actions/checkout@v6
125136
with:
126137
submodules: recursive
127138
fetch-depth: 0
128139

129140
- name: Cache Zotero Bibliography
130141
id: cache-bib
131-
uses: actions/cache@v4
142+
uses: actions/cache@v5
132143
with:
133144
path: |
134145
static/data/bibliography.json
@@ -154,25 +165,26 @@ jobs:
154165
155166
- name: Setup Pages
156167
id: pages
157-
uses: actions/configure-pages@v5
168+
uses: actions/configure-pages@v6.0.0
158169

159170
- name: Setup Node
160-
uses: actions/setup-node@v4
171+
uses: actions/setup-node@v6
161172
with:
162-
node-version: 18
163-
164-
- run: npm install -g autoprefixer --save-dev
165-
- run: npm install -g postcss-cli --save-dev
166-
- run: npm install --verbose
173+
node-version: 24
174+
cache: 'npm'
175+
176+
- name: Install dependencies
177+
run: |
178+
npm ci
167179
168180
- name: Build
169181
env:
170182
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
171-
TZ: America/New York
183+
TZ: America/New_York
172184
run: hugo --cleanDestinationDir -e $HUGO_ENVIRONMENT
173185

174186
- name: Upload artifact
175-
uses: actions/upload-pages-artifact@v3
187+
uses: actions/upload-pages-artifact@v5.0.0
176188
with:
177189
path: ./public
178190

@@ -187,5 +199,5 @@ jobs:
187199
steps:
188200
- name: Deploy to GitHub Pages
189201
id: deployment
190-
uses: actions/deploy-pages@v4
202+
uses: actions/deploy-pages@v5
191203

0 commit comments

Comments
 (0)