From 698452a7ec867c730e2f12c5d600295b1dff5a5f Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 4 Jun 2024 10:03:00 +1200 Subject: [PATCH] FIX Skip following steps if no dispatch should happen --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index e8ba3ee..cab3c8d 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,7 @@ runs: echo "type=$type" >> $GITHUB_OUTPUT - name: Check if should dispatch workflow + id: checkshoulddispatch shell: bash env: RUN_BRANCHES_ON_PREVIOUS_MAJOR: "false" @@ -38,11 +39,14 @@ runs: major_type=$(echo $TYPE | cut -d "," -f 1) if [[ $RUN_BRANCHES_ON_PREVIOUS_MAJOR == "false" ]] && [[ $major_type == "previous" ]]; then echo "Workflow is configured to not dispatch workflow for branches on previous major. Exiting." + echo "do_dispatch=false" >> $GITHUB_OUTPUT exit 0 fi + echo "do_dispatch=true" >> $GITHUB_OUTPUT - name: Get branch id: getbranch + if: steps.checkshoulddispatch.outputs.do_dispatch == 'true' shell: bash env: TYPE: ${{ steps.gettype.outputs.type }} @@ -119,6 +123,7 @@ runs: echo "branch=$branch" >> $GITHUB_OUTPUT - name: Send API request + if: steps.checkshoulddispatch.outputs.do_dispatch == 'true' shell: bash env: GITHUB_REPOSITORY: ${{ github.repository }}