Skip to content

Commit fa20281

Browse files
authored
Merge pull request #2624 from firebase/jh-trusted-publisher
Migrating to trusted publisher
2 parents 442722a + ebbee63 commit fa20281

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

.github/workflows/npm_publish_bq_scripts.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ on:
77
description: "The package name to publish"
88
required: true
99
default: "@firebaseextensions/fs-bq-schema-views"
10+
permissions:
11+
id-token: write
1012
jobs:
1113
publish_if_newer_version:
1214
runs-on: ubuntu-latest
1315
name: publish_if_newer_version
1416
steps:
15-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1618
- name: Setup node
17-
uses: actions/setup-node@v3
19+
uses: actions/setup-node@v4
1820
with:
1921
node-version: 20
2022
- name: NPM install
@@ -23,26 +25,20 @@ jobs:
2325
if:
2426
${{ github.event.inputs.package_name ==
2527
'@firebaseextensions/fs-bq-schema-views'}}
26-
env:
27-
NPM_TOKEN: ${{ secrets.NPM_TOKEN_BQ_SCHEMA_VIEWS }}
2828
run: |
2929
cd firestore-bigquery-export/scripts/gen-schema-view
3030
${{ github.workspace }}/.github/workflows/scripts/npm_publish.sh
3131
- name: Publish BigQuery Import Collection
3232
if:
3333
${{ github.event.inputs.package_name ==
3434
'@firebaseextensions/fs-bq-import-collection'}}
35-
env:
36-
NPM_TOKEN: ${{ secrets.NPM_TOKEN_BQ_IMPORT_COLLECTION }}
3735
run: |
3836
cd firestore-bigquery-export/scripts/import
3937
${{ github.workspace }}/.github/workflows/scripts/npm_publish.sh
4038
- name: Publish BigQuery Change Tracker
4139
if:
4240
${{ github.event.inputs.package_name ==
4341
'@firebaseextensions/firestore-bigquery-change-tracker'}}
44-
env:
45-
NPM_TOKEN: ${{ secrets.NPM_TOKEN_BQ_CHANGE_TRACKER }}
4642
run: |
4743
cd firestore-bigquery-export/firestore-bigquery-change-tracker
4844
${{ github.workspace }}/.github/workflows/scripts/npm_publish.sh

.github/workflows/scripts/npm_publish.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,5 @@ if npm_package_version_exists "$NPM_PACKAGE_NAME" "$NPM_PACKAGE_VERSION"; then
6262
exit 0
6363
fi
6464

65-
# Ensure that the NPM_TOKEN env variable is defined before we can publish the package.
66-
if [[ -z "$NPM_TOKEN" ]]; then
67-
echo "Missing required NPM_TOKEN env variable. Set this on the workflow action or on your local environment."
68-
echo "Skipping publishing of this NPM package."
69-
exit 1
70-
fi
71-
72-
echo "NPM package $NPM_PACKAGE_NAME and version $NPM_PACKAGE_VERSION does NOT EXIST on the NPM registry."
73-
npm config set //wombat-dressing-room.appspot.com/:_authToken=${NPM_TOKEN}
74-
7565
echo "Attempting to publish $NPM_PACKAGE_NAME version $NPM_PACKAGE_VERSION..."
76-
# This registry allows Googlers to publish with a temporary token from http://go/npm-publish
77-
npm publish --registry https://wombat-dressing-room.appspot.com
66+
npm publish

0 commit comments

Comments
 (0)