Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/release_workspace_version.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
name: Prior Version Release Workspace

on:
workflow_dispatch:
inputs:
workspace:
description: 'Name of the Workspace'
required: true
type: string
force_release:
description: 'Force release even if no changesets are present'
required: false
type: boolean
branch:
description: 'Branch to run the workflow on'
required: true
default: ''
type: string
Comment on lines +4 to +18

Choose a reason for hiding this comment

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

Action required

1. Manual dispatch will fail 🐞 Bug ⛯ Reliability

workflow_dispatch was added, but the workflow’s first job still unconditionally reads
github.event.pull_request.*, which does not exist for manual runs. As a result, manually
triggering the workflow will fail or compute empty outputs, and the new workspace/branch inputs
are not wired into the job logic.
Agent Prompt
## Issue description
Manual `workflow_dispatch` runs will fail because the workflow assumes a `pull_request` event payload (`github.event.pull_request.*`) even when triggered manually. The newly added `workspace`/`branch` inputs are not integrated into the job logic.

## Issue Context
This workflow is now triggered by both `pull_request: closed` and `workflow_dispatch`. For `workflow_dispatch`, there is no `pull_request` object in the event payload.

## Fix Focus Areas
- .github/workflows/release_workspace_version.yml[3-66]
- .github/workflows/release_workspace_version.yml[67-90]
- .github/workflows/release_workspace_version.yml[150-167]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

# ADDED: Only trigger on PR closed event on workspace/** branch.
# The assumption is that branch protection rules and CODEOWNERS are configured.

Expand Down Expand Up @@ -109,6 +124,7 @@ jobs:

- name: Check if release
id: release_check
if: inputs.force_release != true
run: |
yarn install
node scripts/ci/check-if-release.js
Expand All @@ -120,7 +136,7 @@ jobs:

- name: Update Version Packages (${{ needs.check-merged-pr.outputs.workspace_name }}) PR
id: changesets-pr
if: steps.release_check.outputs.needs_release != 'true'
if: steps.release_check.outputs.needs_release != 'true' || inputs.force_release != true

Choose a reason for hiding this comment

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

Action required

3. Wrong changesets if logic 🐞 Bug ✓ Correctness

The updated condition for the changesets-action step uses || inputs.force_release != true, which
causes the PR-creation step to run when needs_release is 'true' but force_release is false.
This defeats the intent of skipping PR creation when version bumps (and thus a release) are already
detected.
Agent Prompt
## Issue description
The changesets-action step gating logic is incorrect. It will run when `needs_release` is `'true'` and `force_release` is not true, which is the opposite of the intended behavior (skip PR creation when a release is already needed).

## Issue Context
`check-if-release.js` explicitly emits `needs_release=true` when version bumps are present.

## Fix Focus Areas
- .github/workflows/release_workspace_version.yml[125-146]
- scripts/ci/check-if-release.js[133-147]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

uses: backstage/changesets-action@a39baf18913e669734ffb00c2fd9900472cfa240 # v2.3.2
with:
title: Version Packages (${{ needs.check-merged-pr.outputs.workspace_name }})
Expand All @@ -135,7 +151,7 @@ jobs:
name: Prior Version Release workspace ${{ needs.check-merged-pr.outputs.workspace_name }} on branch ${{ github.ref }}
runs-on: ubuntu-latest
needs: check-merged-pr
if: needs.check-merged-pr.outputs.is_version_pr == 'true'
if: needs.check-merged-pr.outputs.is_version_pr == 'true' || needs.check-merged-pr.outputs.needs_release == 'true' || inputs.force_release == true

Choose a reason for hiding this comment

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

Action required

2. Release checks wrong output 🐞 Bug ✓ Correctness

The release job condition references needs.check-merged-pr.outputs.needs_release, but
check-merged-pr does not output needs_release. This makes the new “run release when
needs_release is true” behavior non-functional.
Agent Prompt
## Issue description
The `release` job checks `needs.check-merged-pr.outputs.needs_release`, but that output does not exist on `check-merged-pr`. As a result, the new release gating will never trigger based on `needs_release`.

## Issue Context
`needs_release` is currently exported by the `changesets-pr` job, not `check-merged-pr`. The `release` job must either depend on `changesets-pr` or compute/export `needs_release` elsewhere.

## Fix Focus Areas
- .github/workflows/release_workspace_version.yml[67-80]
- .github/workflows/release_workspace_version.yml[150-156]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

defaults:
run:
working-directory: ./workspaces/${{ needs.check-merged-pr.outputs.workspace_name }}
Expand Down