Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created July 2, 2020 13:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save typeoneerror/13be540e232adcadf2b471dc9d81b3ad to your computer and use it in GitHub Desktop.
# This works for PUSH but not PULL_REQUEST
if: "!contains(github.event.head_commit.message, '[skipci]')"
# So down here in the STEP, grab the commit message via git log
# But now how do I EXIT the workflow??
- name: Skip if commit contains skipci
run: |
commitmsg=$(git log --format=%B -n 1 ${{ github.event.after }})
if [[ $commitmsg =~ \[skipci\] ]]; then
echo "::debug::Skipping run because commit contained [skipci]"
# FIXME: Kill job?
echo "exit"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment