Fix insufficient create-release condition in GitHub Action#2730
Merged
cliffhall merged 5 commits intomodelcontextprotocol:mainfrom Sep 18, 2025
Merged
Conversation
- in create-release job condition
- check for all combinations of publish results that should lead to a release creation
- npm = success / pypi = skipped
- npm = skipped / pypi = success
- npm = success / pypi = success
- in create-release job condition
- check for all combinations of publish results that should lead to a release creation
- npm = success / pypi = skipped
- npm = skipped / pypi = success
- npm = success / pypi = success
- in create-release job condition
- check for all combinations of publish results that should lead to a release creation
- npm = success / pypi = skipped
- npm = skipped / pypi = success
- npm = success / pypi = success
f5c517a to
e545918
Compare
domdomegg
reviewed
Sep 18, 2025
Member
domdomegg
left a comment
There was a problem hiding this comment.
I think the use of always() is not super obvious here - a comment might be useful to explain why it's there?
We might also be able to simplify this more - just checking that at least one has published successfully. If that's the case, even if the other has failed, I think we'd still want to create a GitHub release.
Have raised cliffhall#2 as a potential suggestion
felixweinberger
requested changes
Sep 18, 2025
- in create-release job condition
- simplify condition
felixweinberger
previously approved these changes
Sep 18, 2025
- in create-release job condition
- add comments about use of always
felixweinberger
approved these changes
Sep 18, 2025
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
.github/workflows/release.ymlcreate-releasejob conditionalways()to force evaluation, even if one or more dependencies failed or was skippedMotivation and Context
We still have a problem with Automatic Release Creation where if there are only changes to be published to npm OR pypi BUT NOT both, the final
create-releasejob will not be run. See this recent Action where TypeScript changes were published to npm, but thecreate-releasejob was not run.The problem
The original condition
needs.update-packages.outputs.changes_made == 'true'in thecreate-releasejob was insufficient because it only checked whether changes were made to packages, but completely ignored the success or failure status of the dependent publishing jobs (publish-pypiandpublish-npm). Also, sincealways()was not part of the condition, it was actually never evaluated in a mixed success case, because theneedsfield dependencies must all succeed before the condition is evaluated.The fix
always()to ensure the condition is evaluated even if some dependent jobs fail or are skipped. Withoutalways(), if eitherpublish-pypiorpublish-npmfailed or were skipped, the release job would be automatically skipped, even if the other publishing job succeeded.How Has This Been Tested?
🤞🏻
Breaking Changes
Types of changes
Checklist
Additional context
NOTE: When there have only been changes to the README, i.e., adding official/community servers to the list, but neither npm nor pypi changes to publish, the
create-releasescript would not run.