mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-25 15:25:15 +02:00
Fix create-release job condition to properly handle skipped publish jobs
The previous condition had two issues: 1. `always()` was incorrectly placed after the changes_made check, making it ineffective 2. The condition was overly verbose with explicit OR checks for all combinations This fix: - Moves `always()` to the beginning so the condition evaluates even when publish jobs are skipped - Simplifies the logic to check if at least one publish job succeeded - Adds documentation explaining why always() is needed Without `always()` at the start, the job would never run when dependencies are skipped, and the result checks would never be evaluated.
This commit is contained in:
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@@ -193,11 +193,13 @@ jobs:
|
|||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
needs: [update-packages, create-metadata, publish-pypi, publish-npm]
|
needs: [update-packages, create-metadata, publish-pypi, publish-npm]
|
||||||
|
# create release when we've published a new version to npm or pypi
|
||||||
|
# always() is needed to evaluate this condition even when dependency jobs are skipped
|
||||||
|
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif
|
||||||
if: |
|
if: |
|
||||||
(needs.update-packages.outputs.changes_made == 'true' && always()) &&
|
always() &&
|
||||||
((needs.publish-pypi.result == 'success' && needs.publish-npm.result == 'skipped') ||
|
needs.update-packages.outputs.changes_made == 'true' &&
|
||||||
(needs.publish-pypi.result == 'skipped' && needs.publish-npm.result == 'success') ||
|
(needs.publish-pypi.result == 'success' || needs.publish-npm.result == 'success')
|
||||||
(needs.publish-pypi.result == 'success' && needs.publish-npm.result == 'success'))
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: release
|
environment: release
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
Reference in New Issue
Block a user