Restricting project to one branch

oliver's Avatar


12 Jul, 2018 06:53 AM


After this conversation:
I decided to set up 2 AppVeyor projects for one github repository:
* for master : * for all others:

In order for this to work, I have to make the setting of the branch in the UI. This is a screenshot of the "master" project:

However, this AppVeyor project is also triggered when I push a commit to develop branch.
Can you help me?

  1. Support Staff 1 Posted by Owen McDonnell on 12 Jul, 2018 03:55 PM

    Owen McDonnell's Avatar

    Could you try exporting yaml from your UI settings and checking that into the master branch?

  2. 2 Posted by oliver on 12 Jul, 2018 07:13 PM

    oliver's Avatar

    Hi Owen.

    I don't understand how that could work.
    I will not be able to maintain different yaml config files between the branches.
    Or is this merely for a test purpose?


    I just tried it with this addition to the config:

              - master

    the result is in the screenshot bellow

  3. 3 Posted by oliver on 12 Jul, 2018 07:17 PM

    oliver's Avatar

    uploading file vivaldi_2018-07-12_21-15-09.png

  4. 4 Posted by oliver on 12 Jul, 2018 07:23 PM

    oliver's Avatar

    full config:

      version: 0.1.{build}
              secure: xxxxxx
              secure: xxxxxx
              secure: xxxxxx
              secure: xxxxxx
          TIMEOUT_MINS: 30
              - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
                PowershellVersion: "5.1"
              - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
                PowershellVersion: "6.0.2"
              - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
                PowershellVersion: "6.0.2"
              - master
      # Fail the Build with the first Job that fails
          fast_finish: true
      # Don't rebuild when a release is tagged on GitHub
      skip_tags: true
      # Logic for skipping CI is in the build script
          do_not_increment_build_number: true
          - ps: |
              if (-not ($env:PowershellVersion)) {$env:PowershellVersion = "5.1"}
              if (([version]$env:PowershellVersion).Major -ge 6) {$env:posh = "pwsh"} else {$env:posh = "powershell"}
              Add-Content (Join-Path $Home ".git-credentials") "https://$($env:GITHUB_ACCESS_TOKEN)`n"
          - git config --global credential.helper "store --file ~/.git-credentials"
          - git config --global "[email blocked]"
          - git config --global "AtlassianPS automation"
          - git config --global core.autocrlf "false"
          - ps: '& $env:posh -File "./Tools/setup.ps1"'
          - ps: '& $env:posh -Command "Invoke-Build"'
      # on_failure:
          # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString(''))
  5. Support Staff 5 Posted by Owen McDonnell on 12 Jul, 2018 07:40 PM

    Owen McDonnell's Avatar

    Yes, just as a test.

    I'm a little confused by your exported Yaml.
    This config setting seems to be working as it should.

        - master
    but you're saying that your setting in the UI, from which you exported this is like the screenshot above (i.e. 'Only branches specified below' and not 'All except branches specified below')?
  6. 6 Posted by oliver on 12 Jul, 2018 07:44 PM

    oliver's Avatar

    I have 2 AppVeyor projects:
    1) AtlassianPS.Configuration --- which only takes branch master
    2) AtlassianPS.Configuration@next --- which takes anything but branch master

    I exported for the 2) of these.
    Here a screenshot:

  7. Support Staff 7 Posted by Owen McDonnell on 12 Jul, 2018 08:01 PM

    Owen McDonnell's Avatar

    Yes, this much i understood...
    But i'm trying to verify that the simple 'Export YAML' tab exported the exact same

        - master
    for two different 'Braches to build' settings in the 'General' tab.

    If you have 'Branches to build' setting 'Only branches specified below' to master this should yield

        - master
  8. 8 Posted by oliver on 12 Jul, 2018 08:04 PM

    oliver's Avatar

    Here both side by side:

  9. Support Staff 9 Posted by Owen McDonnell on 12 Jul, 2018 09:04 PM

    Owen McDonnell's Avatar

    Ok, I think we got out of sync earlier when i asked you to commit appveyor.yml as a test I meant to check it into the master branch not add that config to existing appveyor.yml in develop branch.

    Anyway, my colleague pointed me to this answer he gave to someone with the same problem you're facing.

    The summary is that the appveyor.yml config file is being picked up and read when any branch is commited to. The solution is to keep both projects strictly UI config based or config file based, in which case you'll need to use alternate yaml file naming or alternate yaml file location

  10. 10 Posted by oliver on 12 Jul, 2018 09:21 PM

    oliver's Avatar

    that fixed it.
    Thank you

  11. oliver closed this discussion on 12 Jul, 2018 09:21 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? 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