Skip to content

Commit 27ff7a8

Browse files
committed
fix: add provenance
1 parent 99c2059 commit 27ff7a8

File tree

3 files changed

+80
-8
lines changed

3 files changed

+80
-8
lines changed
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Auto format
3+
4+
on:
5+
push:
6+
branches: [main]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read # for checkout
14+
15+
jobs:
16+
run:
17+
name: Can the code be formatted? 🤔
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-node@v3
22+
with:
23+
node-version: lts/*
24+
- run: corepack enable && pnpm --version
25+
- run: pnpm install --ignore-scripts
26+
- run: pnpm format
27+
- run: git restore .github/workflows
28+
- uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1
29+
id: generate-token
30+
with:
31+
app_id: ${{ secrets.ECOSCRIPT_APP_ID }}
32+
private_key: ${{ secrets.ECOSCRIPT_APP_PRIVATE_KEY }}
33+
- uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5
34+
with:
35+
author: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
36+
body: I ran `pnpm format` 🧑‍💻
37+
branch: actions/format
38+
commit-message: 'chore(format): 🤖 ✨'
39+
labels: 🤖 bot
40+
title: 'chore(format): 🤖 ✨'
41+
token: ${{ steps.generate-token.outputs.token }}

.github/workflows/test.yml .github/workflows/main.yml

+37-7
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,39 @@ on:
88
- beta
99
- main
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read # for checkout
17+
1118
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
name: Lint & Build
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: lts/*
27+
- run: corepack enable && pnpm --version
28+
- run: pnpm install
29+
- run: pnpm type-check
30+
- run: pnpm lint
31+
- run: pnpm build
32+
1233
test:
1334
runs-on: ${{ matrix.platform }}
1435
name: Node.js ${{ matrix.node-version }} / ${{ matrix.platform }}
1536
strategy:
1637
fail-fast: false
1738
matrix:
18-
platform: [ubuntu-latest]
19-
node-version: [lts/*, current]
39+
platform: [macos-latest, ubuntu-latest, windows-latest]
40+
node-version: [lts/*]
2041
include:
21-
- platform: macos-latest
22-
node-version: lts/*
42+
- platform: ubuntu-latest
43+
node-version: current
2344
steps:
2445
- uses: actions/checkout@v3
2546
- uses: actions/setup-node@v3
@@ -28,11 +49,15 @@ jobs:
2849
- run: corepack enable && pnpm --version
2950
- run: pnpm install
3051
- run: pnpm test
31-
- run: pnpm lint
3252

3353
release:
54+
permissions:
55+
contents: write # to be able to publish a GitHub release
56+
issues: write # to be able to comment on released issues
57+
pull-requests: write # to be able to comment on released pull requests
58+
id-token: write # to enable use of OIDC for npm provenance
3459
name: 'Semantic release'
35-
needs: test
60+
needs: [build, test]
3661
runs-on: ubuntu-latest
3762
steps:
3863
- uses: actions/checkout@v3
@@ -53,8 +78,13 @@ jobs:
5378
# Build docs
5479
- run: npm run docs:build
5580
# Deploy docs
81+
- uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1
82+
id: generate-token
83+
with:
84+
app_id: ${{ secrets.ECOSCRIPT_APP_ID }}
85+
private_key: ${{ secrets.ECOSCRIPT_APP_PRIVATE_KEY }}
5686
- uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3
5787
if: ${{ github.ref == 'refs/heads/main' }}
5888
with:
59-
github_token: ${{ secrets.GITHUB_TOKEN }}
89+
github_token: ${{ steps.generate-token.outputs.token }}
6090
publish_dir: ./docs

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
"node": "^14.13.1 || >=16.0.0"
149149
},
150150
"publishConfig": {
151-
"access": "public"
151+
"access": "public",
152+
"provenance": true
152153
}
153154
}

0 commit comments

Comments
 (0)