Skip to content

Commit

Permalink
Merge pull request #209 from LyraPhase/fix-automerge-ci-permissions
Browse files Browse the repository at this point in the history
git-flow-automerge: Debug GitHub actions boolean statement
  • Loading branch information
trinitronx authored Sep 20, 2023
2 parents 0721524 + 0293491 commit eb7070c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/git-flow-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,24 @@ jobs:
outputs:
sha: ${{ steps.master_branch.outputs.sha }}
authorized: ${{ steps.check_user_permissions.outputs.require-result }}
debug-automerge:
runs-on: ubuntu-latest
needs: master-branch
steps:
- name: Debug needs.master-branch.outputs.authorized
run: echo ${{ needs.master-branch.outputs.authorized }}
- name: Debug Authorized == true
run: echo DEBUG AUTHZ = ${{ needs.master-branch.outputs.authorized == true }}
- name: Debug Authorized fromJson
run: echo DEBUG AUTHZ = ${{ fromJSON(needs.master-branch.outputs.authorized) }}
- name: Debug Authorized fromJson to Boolean ... fromJSON(needs.master-branch.outputs.authorized) == true
run: echo DEBUG AUTHZ = ${{ fromJSON(needs.master-branch.outputs.authorized) == true }}
- name: Debug Authorized cast to String, then boolean check ...format('{0}', needs.master-branch.outputs.authorized) == 'true'
run: echo DEBUG AUTHZ = ${{ format('{0}', needs.master-branch.outputs.authorized) == 'true' }}
- name: Debug FULL Boolean
run: echo DEBUG BOOLEAN = ${{ needs.master-branch.outputs.authorized == true && github.event.pull_request.merged == true && (contains(github.event.pull_request.labels.*.name, 'release') || github.event.label.name == 'release') }}
automerge:
if: needs.master-branch.outputs.authorized == true && github.event.pull_request.merged == true && (contains(github.event.pull_request.labels.*.name, 'release') || github.event.label.name == 'release')
if: format('{0}', needs.master-branch.outputs.authorized) == 'true' && github.event.pull_request.merged == true && (contains(github.event.pull_request.labels.*.name, 'release') || github.event.label.name == 'release')
runs-on: ubuntu-latest
needs: master-branch
steps:
Expand Down

0 comments on commit eb7070c

Please sign in to comment.