Skip to content

Conversation

mandarini
Copy link
Contributor

@mandarini mandarini commented Oct 10, 2025

Summary

Fixes the release workflow condition that was causing the publish job to run even when no release was created.

Problem

The original workflow had this configuration:

outputs:
  should_publish: steps.release.outputs.release_created

# Later...
if: ${{ needs.release-please.outputs.should_publish }}

release_created returns the string "false" (not a boolean). When evaluated in the if condition with ${{ }}, GitHub Actions treats it as a JavaScript expression where any non-empty string is truthy - including the string "false". This caused the publish job to run even when no release was created.

Solution

Updated the workflow to explicitly compare string values:

  outputs:
    should_publish: ${{ steps.release.outputs.release_created == 'true' }}

  # Later...
  if: ${{ needs.release-please.outputs.should_publish == 'true' }}

Now the condition correctly evaluates:

  • When no release: "false" == "true" → false → publish job skips
  • When release created: "true" == "true" → true → publish job runs

Testing

See this repo: https://github.com/mandarini/test-release

Verified that:

  • Publish job skips when pushing regular commits to main (only Release PR is created)
  • Publish job runs when merging a Release PR (actual release is created)

@mandarini mandarini marked this pull request as ready for review October 10, 2025 10:40
@mandarini mandarini requested a review from o-santi October 10, 2025 10:41
@mandarini mandarini self-assigned this Oct 10, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 18404061286

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.928%

Totals Coverage Status
Change from base Build 18386064843: 0.0%
Covered Lines: 8786
Relevant Lines: 9354

💛 - Coveralls

@mandarini mandarini changed the title fix(ci): evaluate output of release-please correctly fix: evaluate output of release-please correctly Oct 10, 2025
@mandarini mandarini force-pushed the fix/ci-trigger-release-correctly branch from 18efc32 to 4fe2d8a Compare October 10, 2025 13:30
@mandarini mandarini requested a review from o-santi October 10, 2025 13:31
@o-santi o-santi merged commit c2a306e into main Oct 10, 2025
4 of 10 checks passed
@o-santi o-santi deleted the fix/ci-trigger-release-correctly branch October 10, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants