Last active
February 9, 2021 10:11
-
-
Save ybiquitous/c80f15c18319c63cae8447a3be341267 to your computer and use it in GitHub Desktop.
How to "[skip ci]" on GitHub Actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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!' |
@dscho Thanks a lot for your advice! As you pointed out, my usage of the join()
function was wrong. π
I've updated the file, so I would be appreciated if it could help you. π
How do I use this?
Usage
For pull requests
Include [skip ci]
to a pull request title.
For commit pushes
Include [skip ci]
to a commit message.
Official support! πππ
https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(The best workaround I could come up with is to use
format('{0} {1}', github.event.pull_request.title, github.event.pull_request.body)
.)