Skip to content

Commit

Permalink
add merge ok to GHA workflow to simplify branch rules
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Oct 19, 2024
1 parent e00b400 commit 4759b90
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,34 @@ jobs:

- name: Test
run: tox -e ${{ steps.tox-env.outputs.tox-env }}

set_merge_ok:
name: Set Merge OK
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
runs-on: ubuntu-latest
needs:
- lint
- build
outputs:
merge_ok: ${{ steps.set_merge_ok.outputs.merge_ok }}
runs-on: ubuntu-latest
steps:
- id: set_merge_ok
run: echo 'merge_ok=true' >> ${GITHUB_OUTPUT}

merge_ok:
name: Merge OK
if: always()
needs:
- set_merge_ok
runs-on: ubuntu-latest
steps:
- run: |
merge_ok="${{ needs.set_merge_ok.outputs.merge_ok }}"
if [[ "${merge_ok}" == "true" ]]; then
echo "Merge OK"
exit 0
else
echo "Merge NOT OK"
exit 1
fi

0 comments on commit 4759b90

Please sign in to comment.