From 11c751178de3efd97ea4be2e1763836afb3e2809 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 19 Sep 2023 19:12:48 -0600 Subject: [PATCH] git-flow-automerge: Debug GitHub actions boolean statement --- .github/workflows/git-flow-automerge.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/git-flow-automerge.yml b/.github/workflows/git-flow-automerge.yml index 04732df2..386f359f 100644 --- a/.github/workflows/git-flow-automerge.yml +++ b/.github/workflows/git-flow-automerge.yml @@ -34,6 +34,22 @@ 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') runs-on: ubuntu-latest