Repository navigation
[BRE-1935] Phase 2: Convert cd.yml to trigger-actions caller - #136
AmyLGalles wants to merge 2 commits into
Conversation
This converts the cd.yml workflow from the old passwordless-devops dispatch
pattern to the new trigger-actions deployment event pattern, dispatching to
bitwarden/deploy's deploy-passwordless-nodejs.yml receiver workflow.
Changes:
- Replaced passwordless-devops gh workflow run dispatch with trigger-actions
- Removed BW-GHAPP token generation (no longer needed)
- Switched keyvault from gh-org-bitwarden to trigger-actions' internal handling
- Updated action versions (checkout v7.0.0, setup-node v6.3.0)
- Renamed deploy job to trigger-deploy for clarity
- Split deploy job into separate build and trigger-deploy jobs
- Moved artifact upload to build job (runs before trigger)
- Added workflow-level permissions: {}
The build and lint jobs remain in the source repo; deployment logic now lives
in bitwarden/deploy following the BRE-1935 centralization pattern.
This completes Phase 2 (finalize-source) of the BRE-1935 migration.
Phase 3 (wire trigger-actions.yml receiver) is next.
|
@claude review this |
🤖 Bitwarden Claude Code ReviewOverall Assessment: REQUEST CHANGES This review covers the changes to Code Review Details
|
|
|
||
| trigger-deploy: | ||
| name: Trigger deployment | ||
| if: ${{ github.event_name == 'release' }} |
There was a problem hiding this comment.
❌ CRITICAL: trigger-deploy can never run because the workflow has no release trigger.
Details and fix
The on: block (lines 5-9) still only declares push to main and workflow_dispatch, so github.event_name is never release. The job is always skipped, which means no deployment event ever reaches bitwarden/deploy. The PR description says the job is "Triggered on release: published events", but that trigger was never added.
Add the trigger:
on:
push:
branches:
- main
release:
types: [published]
workflow_dispatch:Also, github.event.release.tag_name (line 103) only gets a value on release events.
| data: | | ||
| { | ||
| "tag": "${{ github.event.release.tag_name }}" | ||
| } |
There was a problem hiding this comment.
❓ QUESTION: How does the receiver find this run's packages artifact when the payload only sends tag?
Details
The PR description says bitwarden/deploy will "Download build artifacts from this workflow run". A cross-repository artifact download usually needs the source run_id (and the repository). Neither is in data. If the receiver looks the run up by tag or branch instead, that works, but the generic artifact name packages gets reused by every push to main. Should "run_id": "${{ github.run_id }}" be forwarded here?
Summary
This is Phase 2 of 3 (finalize-source) for migrating passwordless-nodejs's npm publishing workflow to the centralized deploy repo as part of BRE-1935.
What This PR Does
Converts the
cd.ymlworkflow to use trigger-actions deployment events, delegating the actual npm publishing tobitwarden/deploy's standardized workflow.Pattern: Full Migration (like passwordless-java)
Unlike the passwordless-devops hybrid pattern used for
deploy-passwordless-nodejs.yml, this cd.yml workflow follows the full migration pattern:bitwarden/deploy(already merged)Current Workflow
The workflow keeps its build and format steps but replaces the publish logic:
Retained (unchanged):
formatjob: Runs lintingbuildjob: Runs npm build and uploads artifactsModified:
trigger-deployjob: Now emits deployment event tobitwarden/deployrelease: publishedeventsChanges Applied
1. Trigger-Actions Integration
The
trigger-deployjob now usesbitwarden/gh-actions/trigger-actions@main:2. What Gets Forwarded
Single input forwarded to deployment event:
tag: Release tag name (e.g.,v1.0.0)The deploy repo receiver workflow will:
3. Workflow Flow
Before (if this was the old pattern):
After (this PR):
How It Works
Current Flow (After This PR + Phase 3)
Release Published in passwordless-nodejs
Build & Format (this workflow)
formatjob)buildjob)Trigger Deployment (this workflow)
bitwarden/deploydeploy-passwordless-nodejs{ "tag": "v1.0.0" }Publish Runs (bitwarden/deploy)
trigger-actions.ymlreceives deployment eventdeploy-passwordless-nodejs.ymlThree-Stage Migration Status
Phase 1: Draft ✅ Complete
bitwarden/deployPhase 2: Finalize Source ⏳ This PR
Phase 3: Wire Trigger ⏳ Next
trigger-deploy-passwordless-nodejsjob totrigger-actions.ymlComparison with passwordless-java
This follows the same pattern as passwordless-java Phase 2:
release: publishedrelease: publishedTesting Plan
After Phase 3 completes:
Create and publish a test release:
Verify workflow runs:
Verify npm package published
Rollback Plan
If issues arise:
Related
.github/workflows/deploy-passwordless-nodejs.ymlValidation