Skip to content

Commit 3fbcfe3

Browse files
authored
chore(husky): Fixes husky (#346)
1 parent cdc4e50 commit 3fbcfe3

File tree

5 files changed

+1028
-16
lines changed

5 files changed

+1028
-16
lines changed

.github/workflows/node.yml

+44-13
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,60 @@ on:
66
pull_request:
77
branches: [main]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
10-
build:
13+
bundle-and-lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 20.x
20+
- run: npm ci
21+
- run: npx --no-install microbundle
22+
- run: npx --no-install eslint src
23+
24+
test:
25+
needs: bundle-and-lint
1126
runs-on: ubuntu-latest
1227

1328
strategy:
1429
matrix:
15-
# Reduce at EOL - https://nodejs.org/en/about/releases/
16-
node-version: [14.x, 16.x, 18.x]
30+
# Reduce at EOL - https://github.com/nodejs/Release
31+
node-version: [18.x, 20.x]
1732

1833
steps:
19-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
20-
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v4
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-node@v4
2236
with:
2337
node-version: ${{ matrix.node-version }}
2438
- run: npm ci
25-
- run: npx --no-install microbundle
26-
- run: npx --no-install eslint src
2739
- run: npx --no-install jest
28-
- name: Codecov
29-
uses: codecov/[email protected]
30-
- run: npx --no-install semantic-release
31-
if: matrix.node-version == '18.x'
40+
- uses: codecov/[email protected]
41+
release:
42+
needs: test
43+
if: success() && github.ref == 'refs/heads/main'
44+
runs-on: ubuntu-latest
45+
permissions:
46+
contents: write # to be able to publish a GitHub release
47+
issues: write # to be able to comment on released issues
48+
pull-requests: write # to be able to comment on released pull requests
49+
id-token: write # to enable use of OIDC for npm provenance
50+
steps:
51+
- uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
- uses: actions/setup-node@v4
55+
with:
56+
node-version: 20.x
57+
- run: npm ci
58+
- run: npx --no-install microbundle
59+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
60+
run: npm audit signatures
61+
- name: Release
3262
env:
33-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3464
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
65+
run: npx semantic-release

.husky/pre-commit

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
. "$(dirname "$0")/_/husky.sh"
33

44
npx --no-install jest --onlyChanged
5-
npx --no-install pretty-quick --staged
6-
npx --no-install eslint --cache --fix src
5+
npx --no-install lint-staged

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

0 commit comments

Comments
 (0)