# Skipping a given commit or pull request

Depending on your settings, every code change in your repository can trigger Bitrise builds. However, if you need to, you can skip a specific commit or pull request. Skipping means, in this context, that a code change will NOT trigger a build on Bitrise, even if the triggers are set up to do so.

:::caution[Skipped builds and required checks]

Skipping a build means Bitrise reports no status to your Git provider. If you have a required status check in your branch protection rules, a skipped build leaves that check pending and the pull request can't be merged. To pass a required check on pull requests that shouldn't trigger a build, such as documentation-only changes, route them to a Pipeline that reports the required check without running a build. For details, see [Passing a required check on documentation-only pull requests](/bitrise-ci/configure-builds/configuring-build-settings/reporting-the-build-status-to-your-git-hosting-provider#passing-a-required-check-on-documentation-only-pull-requests).

:::

## Preventing a commit from triggering a build

To make sure a specific commit does not trigger a build, include either `[skip ci]` or `[ci skip]` in the commit message:

```text
This is not important, please [skip ci]
```

Or:

```text
I just changed the README 

[ci skip]
```

:::warning[Only the head/last commit message is checked!]

If you push more than one commit, only the last (head) commit’s message will be checked for the `skip ci` pattern!

:::

If you do want to start a build after all, you have two choices:

- Rebase the commit (change the commit message).
- Push another commit.

:::tip[Pushing an empty commit]

Git allows to create and push empty commits. If you want to build a skipped build you can do `git commit --allow-empty -m "I decided to run this"` on the related branch and push the commit.

:::

## Preventing a pull request from triggering a build

Pull requests are treated as (virtual) commits themselves, where the commit message is the title + description of the pull request. It is *not* the commit messages of the individual commits that make up the pull request.

To skip a pull request include the `[skip ci]` pattern in the pull request’s title or its description.

:::important[Individual commit messages are not checked]

Putting the `[skip ci]` pattern in the commit message of individual commits that make up the pull request will not work: the pull request will trigger a build if the appropriate trigger is set up.

:::

Once you decide to not to skip the pull request, you can simply remove the `[skip ci]` pattern from the pull request’s title or description. This should automatically trigger a new build with the latest commit, and all future commits of the pull request will be built too (unless you add a `[skip ci]` pattern again).

## Skipping Steps triggered by a draft PR

When you use the [draft PR function of GitHub](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests), Bitrise inserts an Environment Variable called `GITHUB_PR_IS_DRAFT` into the build Environment Variable list. If this Env Var is available in your build Env Var list, its value is always set to `true`.

You can use the `GITHUB_PR_IS_DRAFT` Env Var in your build as part of a conditional: for example, you can skip certain Steps in builds that are triggered by draft PRs:

```yaml
workflow1:
    steps:
    - script:
        run_if: '{{enveq "GITHUB_PR_IS_DRAFT" ""}}'   
        inputs:
        - content: |-
            #!/usr/bin/env bash
            # fail if any commands fails
            set -e
            # debug log
            set -x
```

In this example, the `run_if` condition means that the Step will only run if the build is NOT triggered by a draft PR.

Yo recommend that you insert below `run_if` command to each Step in your Workflow to skip the Steps.

:::note[Starting a new build after a draft PR]

Clicking the **Ready for review** button on GitHub only triggers a new build on Bitrise if builds from draft pull requests are disabled.

If draft pull requests are enabled to trigger builds and a specific draft pull request already triggered a build, submitting it for review won't trigger a new build. Any previous builds will also contain the draft PR related Env Vars. In this case, we recommend you manually start a brand new build from the website or trigger the CI with a new commit.

:::

## Skipping Bitrise CI

If you manage multi-vendor or multi-platform CI workflows, you might want to skip builds on multiple systems or just on Bitrise.

To skip builds on multiple vendors, use the `skip ci` or `ci skip` keywords.

To skip builds on Bitrise only, use the `skip bitrise` or the `bitrise skip` keywords in your commit messages to prevent Bitrise builds from triggering. With these Bitrise-specific skip keywords, you get finer granularity and avoid unintentionally skipping builds on other parts of your CI pipeline.

## Skipping a comment

PR comments can trigger builds but if you want to prevent that, you can skip a build by adding `[skip ci]` / `[ci skip]` or `[skip bitrise]` /`[bitrise skip]` in the build's PR comments.

If you use tools that automatically comment on PRs and that starts a build, configure your tool to include a skip command in its comments.
