Skip to content

Commit 43c94b0

Browse files
Fix/update npm token to trusted publisher (#183)
* testing npm trusted publishers * trigger pipeline * more logging * final auth test for OIDC * final test trigger * package bump for deploy
1 parent b4bc192 commit 43c94b0

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

.github/workflows/typescript_package_publish.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,37 @@ on:
88
- master
99
paths:
1010
- "models/typescript/**"
11+
12+
# Npm authentication via OpenID Connect (OIDC)
13+
# https://docs.npmjs.com/trusted-publishers
14+
permissions:
15+
id-token: write # Required for OIDC
16+
contents: read
17+
1118
jobs:
1219
build-publish:
1320
name: build-publish-job
1421
runs-on: ubuntu-latest
1522

1623
steps:
1724
- name: Checkout repository
18-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
1926

2027
- name: Setup Node.js
21-
uses: actions/setup-node@v2
28+
uses: actions/setup-node@v4
2229
with:
23-
node-version: '18'
30+
node-version: '20'
2431
registry-url: 'https://registry.npmjs.org'
2532

2633
- name: Install dependencies
2734
run: |
2835
cd ./scripts
2936
yarn
30-
31-
- name: Load secrets from 1Password
32-
uses: 1password/[email protected]
33-
with:
34-
export-env: true # Export loaded secrets as environment variables
35-
env:
36-
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
37-
NODE_AUTH_TOKEN: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/ppzc4jxrwkf3omdmcs7z2wiwum/credential"
37+
38+
# Ensure npm 11.5.1 or later is installed for OIDC support
39+
- name: Update npm
40+
run: npm install -g [email protected]
3841

3942
- name: Publish to npm
4043
run: cd ./models/typescript && npm publish
41-
env:
42-
NODE_AUTH_TOKEN: ${{ env.NODE_AUTH_TOKEN }}
4344

models/typescript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![npm version](https://badge.fury.io/js/gbfs-typescript-types.svg)](http://badge.fury.io/js/gbfs-typescript-types)
44

5-
TypeScript types for parsing and working with General Bikeshare Feed Specification (GBFS) data, ensuring type safety and code consistency in TypeScript projects.
5+
TypeScript types for parsing and working with General Bikeshare Feed Specification (GBFS) data, ensuring type safety and code consistency in TypeScript projects
66

77
## Add the Dependency
88

models/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gbfs-typescript-types",
3-
"version": "1.0.12",
3+
"version": "1.0.14",
44
"description": "Language Bindings for GBFS in Typescript.",
55
"keywords": [
66
"gbfs",

0 commit comments

Comments
 (0)