Skip to content

Skip Required GitHub Actions

Automatically skip GitHub Actions based on branch names, modified resource, slash commands, and more.

Automatically Skip GitHub Actions

Prerequisite Config for Required Statuses

If you want to skip a required status check, you will need to make sure that your branch protection is configured to allow gitStream to bypass status check requirements.

GitHub Branch Protection Config

Configuration Description

Conditions (all must be true):

  • The target branch name includes a specified keyword. Optionally, you can modify this to detect the source branch name.

Automation Actions:

  • Skip the specified CI pipelines.

Automatically Skip GitHub Actions by Branch

# -*- mode: yaml -*-

manifest:
  version: 1.0

on:
  - pr_created
  - commit

# Optionally, you can change pr.target to branch.name
# if you want to trigger based on the source branch name rather then the target branch name.
automations:
  skip_github_action_branch:
    if:
      - {{ pr.target | includes(term='release') }}
    run:
      - action: add-github-check@v1
        args:
          check_name: staging-ci
          conclusion: skipped
      - action: add-comment@v1
        args:
          comment: |
            [gitStream](https://docs.gitstream.cm) automatically skipped staging CI pipelines because this PR targets the release branch.

Configuration Description

Conditions (all must be true):

  • Someone applies one or more specified labels to a PR.

Automation Actions:

  • Skip the specified CI pipelines.

Use Labels to Automatically Skip GitHub Actions

# -*- mode: yaml -*-

manifest:
  version: 1.0

on:
  - label_added
  - label_removed

automations:
  skip_github_action_label:
    if:
      - {{ pr.labels | match(term='experimental') | some }}
    run:
      - action: add-github-check@v1
        args:
          check_name: production-ci
          conclusion: skipped
      - action: add-comment@v1
        args:
          comment: |
            [gitStream](https://docs.gitstream.cm) automatically skipped production CI pipelines because this is labeled for experimental release.

Configuration Description

Conditions (all must be true):

  • A PR modifies specific files or directories.

Automation Actions:

  • Skip a specified GitHub Action.

Automatically Skip GitHub Actions Based on Modified Resources

# -*- mode: yaml -*-

manifest:
  version: 1.0

on:
  - pr_created
  - commit

automations:
  skip_github_action_resource:
    if:
      - {{ files | match(term='docs/') | every }}
    run:
      - action: add-github-check@v1
        args:
          check_name: release-ci
          conclusion: skipped
      - action: add-github-check@v1
        args:
          check_name: mobile-ci
          conclusion: skipped
      - action: add-comment@v1
        args:
          comment: |
            [gitStream](https://docs.gitstream.cm) automatically skipped production CI pipelines because this PR only contains docs changes.

Additional Resources

gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.

Learn More about how gitStream Works.

Related Automations:

More Automations can be found on the Automation Library and Integrations pages.