Skip to content

Commit 6616b2a

Browse files
authored
Configure Trusted Publishing for NPM (#7587)
1 parent 7b2d707 commit 6616b2a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/workflows/npm.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ on:
44
release:
55
types: [published]
66

7-
permissions: read-all
7+
permissions:
8+
contents: read
9+
id-token: write
810

911
jobs:
1012
build_and_publish:
1113
name: "Publish ccf-app package to NPM"
1214
runs-on: ubuntu-latest
1315

1416
steps:
15-
- uses: actions/checkout@v6
16-
- uses: actions/setup-node@v6
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
1719
with:
18-
node-version: 20
20+
node-version: 24
21+
registry-url: "https://registry.npmjs.org"
1922

2023
- name: Get release number from git tag (release) or latest (branch)
2124
run: |
@@ -31,5 +34,5 @@ jobs:
3134
run: |
3235
set -ex
3336
cd js/ccf-app
34-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
37+
echo "registry=https://registry.npmjs.org/" > .npmrc
3538
npm publish microsoft-ccf-app*.tgz --access public

js/ccf-app/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"name": "@microsoft/ccf-app",
3+
"repository": {
4+
"type": "git",
5+
"url": "https://github.com/microsoft/ccf"
6+
},
37
"version": "0.0.0",
48
"description": "CCF app support package",
59
"main": "index.js",

0 commit comments

Comments
 (0)