Build on tag wrongly thinks it's on a different branch than master

I used:

  on:
    branch: master
    appveyor_repo_tag: true

in my deploy:, to only deploy when a tag is made on the master branch. But no deployment was made when I did:

git tag -a appveyor-test
git push --tags

I noticed that somehow Appveyor thinks it's building a branch called appveyor-test, even if no such branch exists (only a tag with that name exists). See the attached screenshot, notice how it thinks both the branch name and tag name is appveyor-test, even if the tag was made on master.

I've now removed the branch: master to avoid this problem. But why is it thinking my tag was pushed on an appveyor-test branch in the first place?

My current .appveyor.yml is at https://github.com/estan/protoc-gen-doc/blob/master/.appveyor.yml.

  1. To clarify, the tag-triggered build that puzzles me is:

    https://ci.appveyor.com/project/estan/protoc-gen-doc/build/1.0.12

    As you can see by the end of the build, it skipped the deployment because it thinks the branch is appveyor-test, not master:

    Skip "GitHub" deployment as no branches matched (build branch is "appveyor-test", deploy on branches "master")
    

    But I clearly have no such branch: https://github.com/estan/protoc-gen-doc/branches , appveyor-test is the name of the tag that was made from master, not the name of a branch.

    This build was made when I still had the branch: master in .appveyor.yml.

  2. AppVeyor sets the name of the branch to tag name if there was no information about tag's base branch in webhook request. You can check request payload in "Recent deliveries" of webhook on GitHub.

  3. I'm seeing the same behavior. My setup is exactly like elvstone's example, with a deployment firing on the master branch but only for tags.

    I can see the GitHub webhook payloads like you mention. Where would this "information about tag's base branch" be found in the payload? For example, in the webhook that fired on the tag from mine, I see nothing referencing "master."

    At this point, I don't see how the example in this documentation link would work:
    https://www.appveyor.com/docs/branches#build-on-tags-github-only

  4. It's in base_ref property of webhook payload. If you tag through GitHub web UI then base_ref is set.

  5. Ah, I see. That's the issue. I'm pushing tags from SourceTree and all the base_ref values from the push event payloads are null.

    Thanks for the clarification.

  6. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:04 AM.

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

Recent Discussions