Skip to content

Commit 6dded88

Browse files
authored
chore: fix npm-publish dependencies and add provenance (#3099)
1 parent 9afaf00 commit 6dded88

File tree

2 files changed

+17
-21
lines changed

2 files changed

+17
-21
lines changed

.github/workflows/release-please.yml

+15-20
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,40 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
87

98
jobs:
109
release-please:
1110
outputs:
12-
pr: ${{ steps.release.outputs.pr }}
11+
release_created: ${{ steps.release.outputs.release_created }}
1312
permissions:
1413
contents: write # to create release commit (googleapis/release-please-action)
1514
pull-requests: write # to create release PR (googleapis/release-please-action)
16-
if: github.event_name == 'push'
1715
runs-on: ubuntu-latest
1816
steps:
19-
- uses: googleapis/release-please-action@v4
20-
id: release
21-
# Standard Conventional Commits: `feat` and `fix`
22-
# node-gyp subdirectories: `bin`, `gyp`, `lib`, `src`, `test`
23-
# node-gyp subcommands: `build`, `clean`, `configure`, `install`, `list`, `rebuild`, `remove`
24-
# Core abstract category: `deps`
25-
# Languages/platforms: `python`, `lin`, `linux`, `mac`, `macos`, `win`, `window`, `zos`
26-
# Documentation: `doc`, `docs`, `readme`
27-
# Standard Conventional Commits: `chore` (under "Miscellaneous")
28-
# Miscellaneous abstract categories: `refactor`, `ci`, `meta`
29-
30-
test:
31-
name: Release Test
32-
needs: [ release-please ]
33-
if: needs.release-please.outputs.pr || startsWith(github.head_ref, 'release-please--')
34-
uses: ./.github/workflows/tests.yml
17+
- uses: googleapis/release-please-action@v4
18+
id: release
19+
# Standard Conventional Commits: `feat` and `fix`
20+
# node-gyp subdirectories: `bin`, `gyp`, `lib`, `src`, `test`
21+
# node-gyp subcommands: `build`, `clean`, `configure`, `install`, `list`, `rebuild`, `remove`
22+
# Core abstract category: `deps`
23+
# Languages/platforms: `python`, `lin`, `linux`, `mac`, `macos`, `win`, `window`, `zos`
24+
# Documentation: `doc`, `docs`, `readme`
25+
# Standard Conventional Commits: `chore` (under "Miscellaneous")
26+
# Miscellaneous abstract categories: `refactor`, `ci`, `meta`
3527

3628
npm-publish:
3729
needs: release-please
3830
if: ${{ needs.release-please.outputs.release_created }}
3931
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
id-token: write # to generate npm provenance statements
4035
steps:
4136
- uses: actions/checkout@v4
4237
- uses: actions/setup-node@v4
4338
with:
4439
node-version: lts/*
4540
registry-url: 'https://registry.npmjs.org'
46-
- run: npm publish --access public
41+
- run: npm publish --provenance --access public
4742
env:
4843
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/tests.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121
- run: pip install --user ruff
22-
- run: ruff check --output-format=github --select="E,F,PLC,PLE,UP,W,YTT" --ignore="E721,PLC1901,S101,UP031" --target-version=py38 .
22+
# Excluding `/gyp` directory as it is been checked in https://github.com/nodejs/gyp-next/ already
23+
- run: ruff check --output-format=github --extend-exclude=gyp --select="E,F,PLC,PLE,UP,W,YTT" --ignore="E721,PLC1901,S101,UP031" --target-version=py38 .
2324

2425
lint-js:
2526
name: Lint JS

0 commit comments

Comments
 (0)