Using a "for" section restricts builds to PRs only
Hi,
I was trying to automatically publish a package to NuGet.org whenever a commit got added to my master branch. To do this, I added the following to my appveyor.yml file:
for:
-
branches:
only:
- master
build:
publish_nuget: true
artifacts:
- path: '**\ConTabs.tdwright.1.1.0.nupkg'
name: NuGetPackage
deploy:
provider: NuGet
api_key:
secure: ghjsPlGg7R8v7U9ZYy9PxUWAJ4ijiCM/pSwXxy5eHarElGSM6gmhfdGH+EqNSsWM
skip_symbols: false
artifact: '**\ConTabs.tdwright.1.1.0.nupkg'
But then I struggled to get it to work. I could see that GitHub was firing webhooks and getting 204s, but AppVeyor was doing nothing. So:
- I tried a few fixes, but none of the commits trigger a build.
- Out of desperation, I tried a pull request and was surprised to see that it worked.
- I then made another commit with the PR still open and this one also triggered the build.
- I then closed the PR and pushed another commit - this one didn't trigger a build.
- Removing the
for
section from my appveyor.yml file and pushing to develop did once again trigger the build.
In other words, there seems to be a causal relationship between that for
section of the YML and whether or not a build was triggered outside of a PR. My intention wasn't to restrict builds to PRs only and as far as I can tell I've not told AppVeyor to do that. According to the docs for this feature, the only effect should be to overwrite certain settings.
What's going on? Have I missed something stupid? Or is there a bug?
Tom
PS Love AppVeyor - thanks for keeping it free!
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 24 Feb, 2018 04:33 AM
It appears to be a bug. Please look at this post for information about fix and a workaround.
2 Posted by Tom Wright on 24 Feb, 2018 08:24 PM
Thanks Ilya. Good to know I'm not going mad!
I did try the workaround listed on the other post, but unfortunately it still didn't work.
Anything else I could try? Or just sit tight until the bug is resolved?
3 Posted by Ilya Finkelshte... on 25 Feb, 2018 09:23 AM
In your case you should probably add something like this in the end of the YAML:
4 Posted by Tom Wright on 25 Feb, 2018 12:11 PM
D'oh! Of course! Treated that like a magic incantation and didn't think about the underlying intent.
Have updated my config and am pleased to report it's building again! Thanks for your help.
Now just need to test the new behaviour I was trying to implement...
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:26 AM.