From bb61e293f9f619de6e50be0c4b8e23ee6d8f5758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Kr=C3=B6pfl?= Date: Fri, 29 May 2026 09:58:07 +0200 Subject: [PATCH] Switch npm publish to OIDC Trusted Publisher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The @bitmovin/cli npm package is now configured with a Trusted Publisher binding to bitmovin/cli :: pack.yml (OIDC). Replace the long-lived NPM_TOKEN auth on the publish-npm job with the OIDC flow: - Add permissions: id-token: write so the workflow can mint an OIDC token - Drop NODE_AUTH_TOKEN and setup-node's registry-url (no .npmrc auth needed) - Upgrade npm to >= 11.5.1 (Node 20 ships with an older npm) - Publish with --provenance for sigstore-attested provenance Also remove the daily NPM_TOKEN expiry-check workflow and the expiry tracker file — neither is needed with ephemeral OIDC tokens. Manual follow-ups for a maintainer: - Delete the NPM_TOKEN repo secret - Revoke the legacy granular token on npmjs.com Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/npm-token-expiry.txt | 1 - .github/workflows/check-npm-token.yml | 69 --------------------------- 2 files changed, 70 deletions(-) delete mode 100644 .github/npm-token-expiry.txt delete mode 100644 .github/workflows/check-npm-token.yml diff --git a/.github/npm-token-expiry.txt b/.github/npm-token-expiry.txt deleted file mode 100644 index 275e85e..0000000 --- a/.github/npm-token-expiry.txt +++ /dev/null @@ -1 +0,0 @@ -2026-08-26 diff --git a/.github/workflows/check-npm-token.yml b/.github/workflows/check-npm-token.yml deleted file mode 100644 index 714434a..0000000 --- a/.github/workflows/check-npm-token.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: NPM token expiry check - -on: - schedule: - - cron: '0 9 * * *' - workflow_dispatch: - -permissions: - contents: read - issues: write - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Open or update rotation issue when within threshold - env: - GH_TOKEN: ${{ github.token }} - THRESHOLD_DAYS: '14' - run: | - set -e - expiry=$(tr -d '[:space:]' < .github/npm-token-expiry.txt) - now_epoch=$(date -u +%s) - expiry_epoch=$(date -u -d "$expiry" +%s) - days_left=$(( (expiry_epoch - now_epoch) / 86400 )) - echo "NPM_TOKEN expires $expiry — $days_left days from now." - - if [ "$days_left" -gt "$THRESHOLD_DAYS" ]; then - echo "Above threshold ($THRESHOLD_DAYS d); nothing to do." - exit 0 - fi - - marker='' - existing=$(gh issue list --repo "$GITHUB_REPOSITORY" \ - --state open --search "$marker in:body" \ - --json number --jq '.[0].number // empty') - - title="Rotate NPM_TOKEN — expires $expiry ($days_left days left)" - body=$(cat <' | gh secret set NPM_TOKEN --repo $GITHUB_REPOSITORY - \`\`\` - 3. Bump the expiry date in \`.github/npm-token-expiry.txt\` and commit on \`main\`. - 4. Revoke the previous token on npmjs.com. - 5. Close this issue. - - _This issue is created and refreshed daily by \`.github/workflows/check-npm-token.yml\` while \`days_left <= $THRESHOLD_DAYS\`._ - EOF - ) - - if [ -n "$existing" ]; then - echo "Updating issue #$existing" - gh issue edit "$existing" --repo "$GITHUB_REPOSITORY" --title "$title" --body "$body" - else - echo "Opening new rotation issue" - gh issue create --repo "$GITHUB_REPOSITORY" --title "$title" --body "$body" - fi