Preventing master CI run when a commit a made on a feature branch
Currently, when I push a commit to a feature branch (linked to a Github PR), appveyor triggers two builds – one for the commit on the PR, and another one for the commit against master. How do I prevent the latter?
My appveyor.yml
doesn't specificy this, since I want the feature branches to build.
branches:
only:
- master
Thanks
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ilya Finkelshte... on 29 Jun, 2017 08:41 PM
Could you please elaborate scenario a little bit? My understanding is the following:
Is my understanding correct?
2 Posted by akshay on 29 Jun, 2017 08:53 PM
So say I have a branch
X
. I push a commit to that branchX
. I want only that branchX
to build, notmaster
. In case a PR has been created for that branch I want it to behave in the same way (i.e. only branchX
should build).When this PR gets merged into
master
, only thenmaster
should build.How do I do this?
3 Posted by Ilya Finkelshte... on 30 Jun, 2017 06:54 PM
OK, now I understand. We have opposite feature, option to set Do not build feature branches with open Pull Requests. We might think of implementing something like *Do not build virtual merge on *, can you please provide some business justification, in what scenario you do not need virtual merge?
As workaround we can propose to edit YAML only in feature branch to have
and then revert this change before merge. Changes in YAML themselves can be done with[skip ci]
or[ci skip]
anywhere to commit message, to avoid triggering unneeded builds. I admin that this is not most elegant solution though...Ilya.
4 Posted by akshay on 30 Jun, 2017 07:13 PM
Our test phase is a heavy weight and un-conventional. It tests the building
of images etc. We use the GH PR feature which checks that the PR must
update with the master before the merge can happen. This ensures the PR is
update with master before a merge, and that a corresponding CI run against
the latest master has happened. So, we would like the flexibility to not
run the virtual merges on every commit on a feature branch, and instead
rely on the CI run triggered by the commit of master merging into the
feature branch.
5 Posted by Ilya Finkelshte... on 01 Jul, 2017 12:54 AM
Do you need this for clean build history, or to free up number of parallel jobs? If later, you can also call one of exit commands at
init
stage ifAPPVEYOR_REPO_BRANCH
ismaster
andAPPVEYOR_PULL_REQUEST_NUMBER
is notNULL
(orDEFINED
if you useCMD
). Job will be stopped immediately, though some time will be still lost on job/VM creation.In any case I created GH issue to track this feature request.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:18 AM.