Skip to content

Instantly share code, notes, and snippets.

@ybiquitous
Last active February 9, 2021 10:11
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ybiquitous/c80f15c18319c63cae8447a3be341267 to your computer and use it in GitHub Desktop.
Save ybiquitous/c80f15c18319c63cae8447a3be341267 to your computer and use it in GitHub Desktop.
How to "[skip ci]" on GitHub Actions
# See also:
# - https://github.com/actions/runner/issues/774
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#push-event-push
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: "[skip ci]" on Actions
on: [push, pull_request]
jobs:
check_skip:
runs-on: ubuntu-latest
if: |
!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]')
steps:
- run: |
echo 'github.event_name: ${{ github.event_name }}'
echo 'github.event:'
echo '${{ toJson(github.event) }}'
build:
needs: check_skip
runs-on: ubuntu-latest
steps:
- run: echo 'Hi!'
@ybiquitous
Copy link
Author

@ybiquitous
Copy link
Author

Usage

For pull requests

Include [skip ci] to a pull request title.

For commit pushes

Include [skip ci] to a commit message.

@ybiquitous
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment