Fix insufficient create-release condition in GitHub Action #2730
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.