Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
git-commit

GitHub Action

Detect CI Trigger

v1.2

Detect CI Trigger

git-commit

Detect CI Trigger

Detect a keyword used to control the CI in the subject line of a commit message

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Detect CI Trigger

uses: xarray-contrib/[email protected]

Learn more about this action in xarray-contrib/ci-trigger

Choose a version

ci-trigger

A github action to detect trigger keywords in the summary line of commit messages

Usage

To use the detect-ci-trigger action in workflows, add a new job:

  detect-ci-trigger:
    name: Detect CI Trigger
    runs-on: ubuntu-latest
    outputs:
      triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2
    - uses: xarray-contrib/ci-trigger@v1
      id: detect-trigger
      with:
        keyword: "<keyword>"

then require the new job in jobs that should be conditionally skipped:

  my-ci-job:
    runs-on: ubuntu-latest
    needs: detect-ci-trigger
    if: needs.detect-ci-trigger.outputs.triggered == 'false'  # for skipped ci
    # if: needs.detect-ci-trigger.outputs.triggered == 'true'  # for explicitly enabled ci
    steps:
    - actions/checkout@v2
    # ...