Skip to content

Commit

Permalink
FIX Skip following steps if no dispatch should happen
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jun 3, 2024
1 parent 65bcb07 commit ceea298
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 "doDispatch=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "doDispatch=true" >> $GITHUB_OUTPUT
- name: Get branch
id: getbranch
if: steps.checkshoulddispatch.outputs.doDispatch == 'true'
shell: bash
env:
TYPE: ${{ steps.gettype.outputs.type }}
Expand Down Expand Up @@ -119,6 +123,7 @@ runs:
echo "branch=$branch" >> $GITHUB_OUTPUT
- name: Send API request
if: steps.checkshoulddispatch.outputs.doDispatch == 'true'
shell: bash
env:
GITHUB_REPOSITORY: ${{ github.repository }}
Expand Down

0 comments on commit ceea298

Please sign in to comment.