Skip to content

Commit 7d19fca

Browse files
authored
Try to fix releases by adding permissions and upgradeing node version (#25)
1 parent bffbcac commit 7d19fca

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

.github/workflows/hotfix.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,27 @@ env:
1313

1414
jobs:
1515
semantic-release:
16-
if: "!startsWith(github.ref, 'refs/tags/') && contains(github.event.head_commit.message, '[hotfix]')"
16+
if: "!startsWith(github.ref, 'refs/tags/') && contains(github.event.head_commit.message, 'hotfix:')"
17+
permissions:
18+
contents: write # to be able to publish a GitHub release
19+
issues: write # to be able to comment on released issues
20+
pull-requests: write # to be able to comment on released pull requests
21+
id-token: write # to enable use of OIDC for npm provenance
1722
runs-on: ubuntu-latest
1823
steps:
1924
- name: Checkout code
2025
uses: actions/checkout@v4
2126

2227
- name: Set up Node.js
23-
uses: actions/setup-node@v3
28+
uses: actions/setup-node@v4
2429
with:
25-
node-version: '16'
30+
node-version: "lts/*"
2631

2732
- name: Install dependencies
28-
run: npm ci
33+
run: npm clean-install
34+
35+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
36+
run: npm audit signatures
2937

3038
- name: Run Semantic Release for Hotfix
3139
env:
@@ -67,9 +75,12 @@ jobs:
6775
platforms: linux/amd64,linux/arm64
6876

6977
cherry-pick:
70-
if: contains(github.event.head_commit.message, '[hotfix]') && startsWith(github.ref, 'refs/heads/main')
78+
if: contains(github.event.head_commit.message, 'hotfix:') && startsWith(github.ref, 'refs/heads/main')
7179
runs-on: ubuntu-latest
7280
needs: docker-build
81+
permissions:
82+
contents: write # to be able to push to the main branch
83+
pull-requests: write # to be able to create a pull request
7384
steps:
7485
- name: Checkout main branch
7586
uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,26 @@ env:
1414
jobs:
1515
semantic-release:
1616
if: "!startsWith(github.ref, 'refs/tags/')"
17+
permissions:
18+
contents: write # to be able to publish a GitHub release
19+
issues: write # to be able to comment on released issues
20+
pull-requests: write # to be able to comment on released pull requests
21+
id-token: write # to enable use of OIDC for npm provenance
1722
runs-on: ubuntu-latest
1823
steps:
1924
- name: Checkout code
2025
uses: actions/checkout@v4
2126

2227
- name: Set up Node.js
23-
uses: actions/setup-node@v3
28+
uses: actions/setup-node@v4
2429
with:
25-
node-version: '16'
30+
node-version: "lts/*"
2631

2732
- name: Install dependencies
28-
run: npm ci
33+
run: npm clean-install
34+
35+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
36+
run: npm audit signatures
2937

3038
- name: Run Semantic Release
3139
env:

0 commit comments

Comments
 (0)