|
31 | 31 | node-version: ${{ matrix.node }} |
32 | 32 | cache: 'npm' |
33 | 33 |
|
34 | | - - name: Smoke GitHub OIDC token exchange for npm publish |
35 | | - shell: bash |
36 | | - run: | |
37 | | - set -euo pipefail |
38 | | - REG=$(npm -s config get registry||:); REG=${REG%/}; : "${REG:=https://registry.npmjs.org}" |
39 | | - HOST=${REG#*://}; HOST=${HOST%%/*} |
40 | | - ID=$(curl -fsS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=npm:${HOST}" | jq -er .value) |
41 | | - PKG=$(jq -r '.name|@uri' package.json) |
42 | | - RESP=$(curl -fsS -H "Authorization: Bearer $ID" "$REG/-/npm/v1/oidc/token/exchange/package/$PKG" -d "") |
43 | | - TOKEN=$(echo "$RESP" | jq -er '.token') |
44 | | - echo "::add-mask::$TOKEN" |
45 | | - [ -n "$TOKEN" ] |
46 | | -
|
47 | 34 | - name: Install dependencies |
48 | 35 | run: npm ci |
49 | 36 |
|
@@ -118,17 +105,30 @@ jobs: |
118 | 105 |
|
119 | 106 | steps: |
120 | 107 | - name: Checkout code |
121 | | - uses: actions/checkout@v4 |
| 108 | + uses: actions/checkout@v5 |
122 | 109 | with: |
123 | 110 | fetch-depth: 0 |
124 | 111 |
|
125 | 112 | - name: Setup Node.js 22.18.0 |
126 | | - uses: actions/setup-node@v4 |
| 113 | + uses: actions/setup-node@v6 |
127 | 114 | with: |
128 | 115 | node-version: 22.18.0 |
129 | 116 | cache: 'npm' |
130 | 117 | registry-url: 'https://registry.npmjs.org' |
131 | 118 |
|
| 119 | + - name: Smoke GitHub OIDC token exchange for npm publish |
| 120 | + shell: bash |
| 121 | + run: | |
| 122 | + set -euo pipefail |
| 123 | + REG=$(npm -s config get registry||:); REG=${REG%/}; : "${REG:=https://registry.npmjs.org}" |
| 124 | + HOST=${REG#*://}; HOST=${HOST%%/*} |
| 125 | + ID=$(curl -fsS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=npm:${HOST}" | jq -er .value) |
| 126 | + PKG=$(jq -r '.name|@uri' package.json) |
| 127 | + RESP=$(curl -fsS -H "Authorization: Bearer $ID" "$REG/-/npm/v1/oidc/token/exchange/package/$PKG" -d "") |
| 128 | + TOKEN=$(echo "$RESP" | jq -er '.token') |
| 129 | + echo "::add-mask::$TOKEN" |
| 130 | + [ -n "$TOKEN" ] |
| 131 | +
|
132 | 132 | - name: Install dependencies |
133 | 133 | run: npm ci |
134 | 134 |
|
|
0 commit comments