Skip to content

Commit

Permalink
Use universal "needs not failed" @ CI conditions
Browse files Browse the repository at this point in the history
This patch refactors the conditionals with hardcoded job IDs into
universal name-agnostic checks.

Refs:
* https://github.com/orgs/community/discussions/45058#discussioncomment-8470000
  • Loading branch information
webknjaz committed Jun 7, 2024
1 parent c815432 commit f5597a0
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,10 @@ jobs:
- pre-setup # transitive, for accessing settings
if: >-
always()
&& needs.check.result == 'success'
&& ! (
contains(needs.*.result, 'skipped')
|| contains(needs.*.result, 'failure')
)
&& fromJSON(needs.pre-setup.outputs.release-requested)
runs-on: ubuntu-latest

Expand Down Expand Up @@ -1573,7 +1576,10 @@ jobs:
- pre-setup # transitive, for accessing settings
if: >-
always()
&& needs.check.result == 'success'
&& ! (
contains(needs.*.result, 'skipped')
|| contains(needs.*.result, 'failure')
)
&& (
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
|| fromJSON(needs.pre-setup.outputs.release-requested)
Expand Down Expand Up @@ -1612,7 +1618,10 @@ jobs:
- pre-setup # transitive, for accessing settings
if: >-
always()
&& needs.publish-pypi.result == 'success'
&& ! (
contains(needs.*.result, 'skipped')
|| contains(needs.*.result, 'failure')
)
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -1706,7 +1715,10 @@ jobs:
- pre-setup # transitive, for accessing settings
if: >-
always()
&& needs.post-release-repo-update.result == 'success'
&& ! (
contains(needs.*.result, 'skipped')
|| contains(needs.*.result, 'failure')
)
runs-on: ubuntu-latest

permissions:
Expand Down Expand Up @@ -1795,7 +1807,10 @@ jobs:
- pre-setup # transitive, for accessing settings
if: >-
always()
&& needs.check.result == 'success'
&& ! (
contains(needs.*.result, 'skipped')
|| contains(needs.*.result, 'failure')
)
&& (
fromJSON(needs.pre-setup.outputs.is-untagged-devel) ||
fromJSON(needs.pre-setup.outputs.release-requested)
Expand Down

0 comments on commit f5597a0

Please sign in to comment.