Skip to content

Commit

Permalink
fixup! Update merge-requires.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
eccles committed Nov 20, 2024
1 parent ab51ab9 commit 334ad49
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 21 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/merge-requires.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,20 @@ on:
push:

jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: Echo github obj
run: echo ${{ toJson(github) }}

ci:
secrets: inherit
uses: ./.github/workflows/ci.yml
release:
secrets: inherit
uses: ./.github/workflows/package.yml

merge-checks-ok:
runs-on: ubuntu-latest
needs: [ci]
needs: [debug, ci]
steps:
- name: Echo github obj
run: echo ${{ toJson(github) }}
- name: ok
run: |
echo "This code is mergeable"
release-checks-ok:
runs-on: ubuntu-latest
needs: [ci, release]
steps:
- name: Echo github obj
run: echo ${{ toJson(github) }}
- name: ok
run: |
if [ "${{github.event_name}}" != "release" ]
then
exit 1
fi
echo "This code is releasable"
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_call:

jobs:
build:
deploy:

runs-on: ubuntu-latest

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release-requires.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow configures the repository specific choices of which CI builds
# must pass in order for a build to merge. This allows a sinlge global teraform
# configured rule to require a "well known" check in each repository. Whilst
# granting repository stakeholders the ability configure what workflows are
# appropriate to satisfy that check.
name: Release Requires
on:
push:

jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: Echo github obj
run: echo ${{ toJson(github) }}

release:
if: ${{github.event_name}} == 'release' }}
secrets: inherit
uses: ./.github/workflows/package.yml

release-checks-ok:
runs-on: ubuntu-latest
needs: [debug, ci, release]
steps:
- name: ok
run: |
if [ "${{github.event_name}}" != "release" ]
then
exit 1
fi
echo "This code is releasable"

0 comments on commit 334ad49

Please sign in to comment.