Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip build if there's [skip ci] in the commit message. #858

Closed
KelvinJin opened this issue Mar 15, 2017 · 32 comments

Comments

Projects
None yet
@KelvinJin
Copy link

commented Mar 15, 2017

Hey, just wonder if there's a way I can skip a build if [skip ci] or something exists in the commit message. I know we have branch filters and path filters, but commit message filter would be nice to have if I just commit something really tiny.

@ericsciple

This comment has been minimized.

Copy link
Member

commented Mar 15, 2017

i think as long as the commit message contains NO_CI then it will skip

@ericsciple

This comment has been minimized.

Copy link
Member

commented Mar 15, 2017

***NO_CI***

@KelvinJin

This comment has been minimized.

Copy link
Author

commented Mar 15, 2017

Aha, good to know. It worked. Thanks!

@KelvinJin KelvinJin closed this Mar 15, 2017

@marceloavf

This comment has been minimized.

Copy link

commented Oct 27, 2017

Basically most of the others CI use [ci skip] or [skip ci] (e.g. Travis, CircleCI, Concourse)

Some dependencies use [ci skip] as a pattern to skip automatically versioning from their CI, why not make VSTS also accept it?

@masters3d

This comment has been minimized.

Copy link

commented Feb 21, 2018

Come Vote here for additional spellings.

@chrislampley

This comment has been minimized.

Copy link

commented Oct 26, 2018

@ericsciple ***NO_CI*** does not work for Azure Pipelines

@azureDaveOps

This comment has been minimized.

Copy link

commented Oct 26, 2018

@chrislampley can you please point me at your account and build, I am curious why it didn't work for you?
You can message me privately if you don't want to share your account information:
daveken@microsoft.com

@chrislampley

This comment has been minimized.

Copy link

commented Oct 26, 2018

@ericsciple PM sent.

@azureDaveOps

This comment has been minimized.

Copy link

commented Oct 27, 2018

Although I am not Eric, he is just a few feet away from me, we will take a look and get back to you, thanks!

@ericsciple

This comment has been minimized.

Copy link
Member

commented Oct 29, 2018

@chrislampley sorry I didn't see any message or I missed it

@rauljmz

This comment has been minimized.

Copy link

commented Dec 11, 2018

***NO_CI*** is also not working for me on Azure Pipelines. Getting endless recursive builds. Is there a solution?

@TingluoHuang

This comment has been minimized.

Copy link
Member

commented Dec 11, 2018

@rauljmz can you provide more detail info?
what's your Azure DevOps account?
what's your definition looks like, the trigger section?
how did you provide the ***NO_CI*** string?

@rauljmz

This comment has been minimized.

Copy link

commented Dec 11, 2018

@TingluoHuang the DevOps account is CluedIn-io. The trigger section is picked up from the YML file and is simply

trigger:
- develop
- master

The original intention is for the pipeline to make an extra commit to the master branch during build. This should not trigger a new build, but despite the ***NO_CI*** flag being in the commit message, it does (causing constant builds).
I have also tried simply pushing a commit manually with the flag too, that also triggers a build.
I have tried putting ***NO_CI*** in the beginning, in the end, with square brackets... running out of options!

@TingluoHuang

This comment has been minimized.

Copy link
Member

commented Dec 11, 2018

@rauljmz if you manually (not during your build) commit a change with ***NO_CI*** in commit message and push it to master, will it trigger a CI build?

@rauljmz

This comment has been minimized.

Copy link

commented Dec 11, 2018

@TingluoHuang Yes it does - I tried that too.

@TingluoHuang

This comment has been minimized.

Copy link
Member

commented Dec 11, 2018

@rauljmz i can repro myself, can you share some screenshot of how do you made the commit message?
this is my message looks like:
image

@rauljmz

This comment has been minimized.

Copy link

commented Dec 11, 2018

@TingluoHuang Of course.
image
The last two, Rev.42 is manual commit and push, Rev.43 is the one generated by the automated commit in the pipeline. Both have ***NO_CI*** yet triggered a pipeline.

The yaml file does this:

  - task: Bash@3
    displayName: 'Commit changes to repo'
    condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
    inputs:
      targetType: 'inline'
      script: "git checkout master; git add docs; git commit -m '[***NO_CI***] Pushed new packaged version of helm chart';git push;"
@TingluoHuang

This comment has been minimized.

Copy link
Member

commented Dec 11, 2018

@madhurig

This comment has been minimized.

Copy link
Contributor

commented Dec 14, 2018

@rauljmz - it appears you are using the Azure Pipelines GitHub app. This is currently a limitation when using the GitHub app and it is something we plan to address.

If you are making commits via the script under a particular folder of in a specific file, you can use PATH filters as a workaround to avoid triggering builds for changes in the specific file or under that folder. E.g. add something like this in your yml file

trigger: branches: include: - master paths: exclude: - docs/*

https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=vsts&tabs=yaml

If that workaround is not something you can apply, you can switch to using PAT or OAuth for authenticating with GitHub. One of the downsides of that is that you won't get checks but will see a status update from the Azure pipelines results.

Thanks,
Madhuri

@rauljmz

This comment has been minimized.

Copy link

commented Dec 15, 2018

@madhurig

This comment has been minimized.

Copy link
Contributor

commented Dec 17, 2018

@rauljmz - thanks for the update. We are working on improvements in the app flow and pipeline creation so the app would be the default way to create pipelines whenever possible.

Thanks,
Madhuri

@nickromano

This comment has been minimized.

Copy link

commented Jan 24, 2019

Another option if you're using YAML builds: create a condition for that step to only run if [skip ci] isn't in the commit message. Unfortunately, you can't do this at the job level because it hasn't pulled sources yet so Build.SourceVersionMessage is null. You'll need to copy it to each step in your pipeline.

steps:
  - bash: echo "Run tests"
    condition: not(contains(variables['Build.SourceVersionMessage'], '[skip ci]'))
@mloskot

This comment has been minimized.

Copy link

commented Jan 25, 2019

Vote for Add support [ci skip] and [azure skip] to Azure Pipelines on the Developer Community

@davidstaheli

This comment has been minimized.

Copy link
Member

commented Mar 22, 2019

This is available now. You can tell Azure Pipelines to skip running a pipeline that a commit would normally trigger. Just include [skip ci] in the commit message or description of the HEAD commit and Azure Pipelines will skip running CI. You can also use any of the variations below. This is supported for commits to Azure Repos Git, Bitbucket Cloud, GitHub, and GitHub Enterprise Server.

  • [skip ci] or [ci skip]
  • skip-checks: true or skip-checks:true
  • [skip azurepipelines] or [azurepipelines skip]
  • [skip azpipelines] or [azpipelines skip]
  • [skip azp] or [azp skip]
  • ***NO_CI***
@Richard-II

This comment has been minimized.

Copy link

commented Apr 18, 2019

As of today, ***NO_CI*** still doesn't work as I expect for Pull Requests in Azure build (self-hosted agents). The build was still triggered despite the inclusion of the magic string in the commit title. Here's a screenshot created from a build today.
noci

How do I apply this change? This is part of the azure-pipelines-agent repo, but surely this isn't a fix requiring me to update my self-hosted agents, is it? I would expect it to be at the agent pool level.

@TingluoHuang

This comment has been minimized.

Copy link
Member

commented Apr 18, 2019

@Richard-II Pull request build should still running even you have ***NO_CI*** in your commit message, only the CI build should stop running when that commit merged into master.

@Richard-II

This comment has been minimized.

Copy link

commented Apr 18, 2019

@TingluoHuang

This comment has been minimized.

Copy link
Member

commented Apr 18, 2019

@Richard-II you need to report the problem on https://developercommunity.visualstudio.com/spaces/21/index.html since the filtering is happened on server side.

@pllim

This comment has been minimized.

Copy link

commented Jun 11, 2019

Re: #858 (comment)

@davidstaheli , can you please clarify because I have a commit message with [skip ci] appended at the end and Azure ran anyway. Thanks!

xref spacetelescope/synphot_refactor#194

@madhurig

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

@pllim - PR builds are always run, [skip ci] only skips CI builds.

@pllim

This comment has been minimized.

Copy link

commented Jun 11, 2019

@pllim - PR builds are always run, [skip ci] only skips CI builds.

Thanks for the quick reply, @madhurig . That is not how Travis CI works though (from which I am transitioning). So how do I ask Azure not to run for a particular commit pushed to an unmerged PR?

@pllim pllim referenced this issue Jun 11, 2019

Open

WIP: Azure pipelines configuration #8445

0 of 4 tasks complete
@pllim

This comment has been minimized.

Copy link

commented Jun 11, 2019

In addition, I noticed that when [skip ci] is in any of the commit messages of a pull request, when that PR is merged, Azure skips from running in master. I guess the current Azure behavior is the opposite of what is desired...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.