Skip to content

[BRE-2094] Update CD workflow and add Publish workflow - #142

Open
vgrassia wants to merge 3 commits into
mainfrom
bre-2094_configure-oidc-for-passwordless-npmjs-package
Open

[BRE-2094] Update CD workflow and add Publish workflow#142
vgrassia wants to merge 3 commits into
mainfrom
bre-2094_configure-oidc-for-passwordless-npmjs-package

Conversation

@vgrassia

@vgrassia vgrassia commented Aug 5, 2026

Copy link
Copy Markdown
Member

🎟️ Tracking

BRE-2094

📔 Objective

This PR updates the CD workflow to attach the build asset to the GitHub release. The Publish workflow was also added as part of the process to securely publish the package on NPM with provenance.

Copilot AI review requested due to automatic review settings August 5, 2026 00:06
@vgrassia vgrassia added the ai-review Request a Claude code review label Aug 5, 2026
@vgrassia
vgrassia requested a review from a team as a code owner August 5, 2026 00:06
@vgrassia vgrassia added the ai-review Request a Claude code review label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the CD workflow rewrite and the new inert publish shim. The deploy job's Azure/Key Vault/GH-App dispatch chain is replaced by a build-and-attach job scoped to contents: write, and tag values are passed through env: rather than interpolated into shell scripts, which avoids script injection. Actions remain SHA-pinned with persist-credentials: false, and publish.yml correctly scopes id-token: write at the job level under a workflow-level permissions: {}.

Code Review Details
  • ❓ : New version gate requires package.json to match the release tag, but it has been 1.0.0 since the initial commit while tags 1.0.1/1.0.1-beta.1 exist — confirming a version-bump step is part of the release runbook
    • .github/workflows/cd.yml:59-67

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the release automation for passwordless-nodejs by changing the CD workflow to attach a build artifact to GitHub Releases and adding a dedicated Publish workflow intended for secure npm publishing with provenance.

Changes:

  • Added a new publish.yml workflow that delegates publishing to a centralized reusable workflow.
  • Updated cd.yml to build on release publish and upload a zipped build artifact to the GitHub Release.
  • Added a guard to verify package.json version alignment with the release tag before building/uploading.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/publish.yml Adds a minimal publish shim that calls a centralized reusable workflow with OIDC permissions.
.github/workflows/cd.yml Replaces prior deployment dispatch logic with building and uploading a release asset, plus a version/tag verification step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/cd.yml
Comment on lines +75 to +76
run: |
zip -r "passwordless-nodejs-${RELEASE_TAG}-npm-build.zip" dist
Comment on lines +14 to +16
contents: read
id-token: write
uses: bitwarden/gh-actions/.github/workflows/_publish-passwordless-nodejs-npm.yml@main
Comment thread .github/workflows/cd.yml
Comment on lines +62 to +67
run: |
PKG_VERSION=$(jq -r '.version' package.json)
if [[ "$PKG_VERSION" != "$RELEASE_TAG" ]]; then
echo "::error::package.json version '${PKG_VERSION}' does not match release tag '${RELEASE_TAG}'"
exit 1
fi
Comment thread .github/workflows/cd.yml
Comment on lines +59 to +67
- name: Verify package.json version matches release tag
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
PKG_VERSION=$(jq -r '.version' package.json)
if [[ "$PKG_VERSION" != "$RELEASE_TAG" ]]; then
echo "::error::package.json version '${PKG_VERSION}' does not match release tag '${RELEASE_TAG}'"
exit 1
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QUESTION: Does the release process now include bumping package.json before tagging?

Context

package.json has been pinned at 1.0.0 since the initial commit (git log -S '"version"' -- package.json shows no bumps), yet tags 1.0.1 and 1.0.1-beta.1 exist. The old flow passed the version downstream explicitly (--field version="${TAG_NAME}"), so the in-repo version never had to match.

With this gate, the next release tagged anything other than 1.0.0 fails here and no asset is attached, blocking publish. That is fine if a version-bump PR is now part of the release runbook — just confirming that step exists, since nothing in this repo automates it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants