Skip to content

Commit 5eb9f42

Browse files
committed
feat: Update to node24
1 parent 6dbf780 commit 5eb9f42

8 files changed

Lines changed: 52 additions & 38 deletions

File tree

.github/workflows/package-action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
push-changes:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v6
1313
with:
1414
ssh-key: "${{ secrets.COMMIT_KEY }}"
15-
- uses: actions/setup-node@v3
15+
- uses: actions/setup-node@v6
1616
with:
17-
node-version: 16
17+
node-version-file: "package.json"
1818
- name: Install Javascript dependencies with npm
1919
run: npm install
2020
- name: Package action for distribution

.github/workflows/test.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,13 @@ jobs:
99
test-action:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- name: Build action on node v16
14-
uses: actions/setup-node@v3
12+
- uses: actions/checkout@v6
13+
- uses: actions/setup-node@v6
1514
with:
16-
node-version: 16
15+
node-version-file: "package.json"
1716
- run: npm install
1817
- run: npm run package
1918
- run: npm run test
20-
- name: Test action on node v20
21-
uses: actions/setup-node@v3
22-
with:
23-
node-version: 20
2419
- id: default
2520
uses: ./
2621
- name: Test current commit hash is used by default

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021 > LIMITED and contributors
3+
Copyright (c) 2026 shr.ink OÜ and contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A GitHub Action for using the long and short [hash of a commit][git/commits]
44
— with an optional prefix.
55

66
```
7-
prompt/actions-commit-hash@v3
7+
prompt/actions-commit-hash@v4
88
```
99

1010
:package: [Automatic Release Packaging](#automatic-release-packaging) is used by
@@ -41,10 +41,10 @@ jobs:
4141
steps:
4242
steps:
4343
- id: commit
44-
uses: prompt/actions-commit-hash@v3
45-
- uses: docker/setup-buildx-action@v3
44+
uses: prompt/actions-commit-hash@v4
45+
- uses: docker/setup-buildx-action@v4
4646
- name: Build image for commit
47-
uses: docker/build-push-action@v5
47+
uses: docker/build-push-action@v7
4848
with:
4949
push: true
5050
tags: ${{ steps.commit.outputs.short }}
@@ -71,13 +71,13 @@ jobs:
7171
steps:
7272
steps:
7373
- id: commit
74-
uses: prompt/actions-commit-hash@v3
74+
uses: prompt/actions-commit-hash@v4
7575
with:
7676
commit: "${{ github.event.workflow_run.head_sha }}"
7777
prefix: "sha-"
78-
- uses: docker/setup-buildx-action@v3
78+
- uses: docker/setup-buildx-action@v4
7979
- name: Build image for commit
80-
uses: docker/build-push-action@v5
80+
uses: docker/build-push-action@v7
8181
with:
8282
push: true
8383
tags: ${{ steps.commit.outputs.short }}
@@ -90,8 +90,8 @@ Any reference to this Action in a Workflow must use a [tag][tags] (mutable) or
9090
the commit hash of a tag (immutable).
9191

9292
```yaml
93-
✅ uses: prompt/actions-commit-hash@v3
94-
✅ uses: prompt/actions-commit-hash@v3.0.0
93+
✅ uses: prompt/actions-commit-hash@v4
94+
✅ uses: prompt/actions-commit-hash@v4.0.0
9595
✅ uses: prompt/actions-commit-hash@01d19a83c242e1851c9aa6cf9625092ecd095d09
9696
❌ uses: prompt/actions-commit-hash@main
9797
```

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ outputs:
2020
hash:
2121
description: "Original, 40-character SHA-1 hash received as `commit` input"
2222
runs:
23-
using: "node20"
23+
using: "node24"
2424
main: "dist/index.js"

package-lock.json

Lines changed: 26 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"actions",
1616
"github-actions"
1717
],
18-
"author": "Samuel Ryan <sam@samryan.co.uk>",
18+
"author": "Samuel Ryan <sam@shr.ink>",
1919
"license": "MIT",
2020
"engines": {
21-
"node": ">=16.0.0"
21+
"node": ">=24.0.0"
2222
},
2323
"dependencies": {
2424
"@actions/core": "^1.3.0"
@@ -27,7 +27,7 @@
2727
"@types/jest": "^26.0.15",
2828
"@types/node": "^14.14.9",
2929
"@typescript-eslint/parser": "^5",
30-
"@vercel/ncc": "^0.25.1",
30+
"@vercel/ncc": "^0.38.4",
3131
"eslint": "^8",
3232
"eslint-plugin-github": "^4.1.1",
3333
"eslint-plugin-jest": "^26",

src/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ async function run(): Promise<void> {
1010
core.setOutput('short', prefix + commit.short())
1111

1212
core.setOutput('hash', commit.long())
13-
} catch (error: any) {
14-
core.setFailed(error.message)
13+
} catch (error: unknown) {
14+
core.setFailed(
15+
error instanceof Error
16+
? error.message
17+
: 'an unknown error occurred when running actions-commit-hash'
18+
)
1519
}
1620
}
1721

0 commit comments

Comments
 (0)