68
42

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CIサービスの自動ビルドをスキップする方法まとめ

Last updated at Posted at 2016-03-27

やりたいこと

リポジトリへのコミットに伴う、CI(Continuous Integration)サービスによる自動ビルド起動を一時的にスキップしたい。
※例えば、ドキュメントのみの更新等、プログラムに変更が無くテストやビルドが不要な場合

方法

コミットメッセージに含まれるキーワードでCI起動を抑制できる。
※各CIサービスが個別にそうした機能を実装している

結論

GitHub Actions/Travis CI/Circle CI/AppVeyer/GitLab CI/CD PipelineのいずれかのCIサービスであれば、
[skip ci]/[ci skip]をコミットメッセージのどこか(行頭でなくても可)に書くとpush時にCI起動をスキップできる。

CIサービス毎の抑制方法

GitHub Actions

下記キーワードのいずれかをコミットメッセージのどこかに記載する:

  • [skip ci]
  • [ci skip]
  • [no ci]
  • [skip actions]
  • [actions skip]

Reference

GitHub Actions: Skip pull request and push workflows with [skip ci] - GitHub Changelog

If any commit message in your push or the HEAD commit of your PR contains the strings [skip ci], [ci skip], [no ci], [skip actions], or [actions skip] workflows triggered on the push or pull_request events will be skipped.

Travis CI

下記キーワードをコミットメッセージのどこかに記載する:

  • [<ci|travis|travis ci|travis-ci|travisci> skip]
  • [skip <ci|travis|travis ci|travis-ci|travisci>]

Reference

Customizing the Build - Travis CI

Circle CI

下記キーワードのいずれかをコミットメッセージのどこかに記載する:

  • [ci skip]
  • [skip ci]

Reference

Skip and Cancel Builds - CircleCI

CircleCI won't run the build if we find [ci skip] or [skip ci] anywhere in the commit message of the head commit. You can use the handy retry button on the build page if you decide that you want to run the build after all.

AppVeyor

下記キーワードのいずれかをコミットメッセージのどこかに記載する:

  • [skip ci]
  • [ci skip]
  • [skip appveyor]

Reference

Setting up commits filtering | AppVeyor

Add [skip ci] or [ci skip] to commit message title and build won’t be triggered by AppVeyor for that commit. Or explicitly skip AppVeyor only with [skip appveyor] and still allow any other CI to build the commit (eg. Travis CI).

GitLab CI/CD Pipeline

下記キーワードのいずれかをコミットメッセージのどこかに記載する:

  • [skip ci]
  • [ci skip]

もしくは、

  • git push -o ci.skipオプションを使う

Reference

Keyword reference for the .gitlab-ci.yml file | GitLab

To push a commit without triggering a pipeline, add [ci skip] or [skip ci], using any capitalization, to your commit message.
Alternatively, if you are using Git 2.10 or later, use the ci.skip Git push option. The ci.skip push option does not skip merge request pipelines.

まとめ

Keyword GitHub Actions Travis CI Circle CI AppVeyor GitLab CI
[skip ci]
[ci skip]
[no ci]
[skip actions]
[actions skip]
[skip <TRAVIS>]
[<TRAVIS> skip]
[skip appveyor]
  • : スキップ可
  • TRAVIS: travis|travis ci|travis-ci|travisci

GitHub Actions/Travis CI/Circle CI/AppVeyer/GitLab CIに共通するCIのスキップが可能なコミットメッセージのキーワードは[skip ci]/[ci skip]

68
42
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
68
42

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?