With Travis CI, we can skip the build for a particular commit with adding a suffix to a commit. This is described at Travis CI. I find this feature practical when I only edit README.md
which is not code-related and the pre-flight build doesn't need to be triggered.
[skip ci]
How do I skip the jobs trigged on: push
events using GitHub Actions?
name: Maven Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check-out project
uses: actions/checkout@v1
- name: Set up JDK 11.0.3
uses: actions/setup-java@v1
with:
java-version: 11.0.3
- name: Build with Maven
run: mvn -B package --file pom.xml
Answers summary:
Big thanks to all the answerers providing various ways to achieve it. I bet everybody would need something a little bit different regarding to the origin of their problem and the CI approach. Here are the answers listed for a quick navigation:
readme.md
file: https://stackoverflow.com/a/61876395/3764965[skip ci]
as a new GitHub feature:
[skip ci]
message by parsing (customizable solution):
All the answers deserve upvote! If you like my question, you should double-like the answers.
Also, for files and directories you want ignored on all pushes you can configure the workflow itself:
on:
push:
paths-ignore:
- 'README.md'