grunt-release
grunt-release copied to clipboard
'Warning: Error creating github release.', "Published releases must have a valid tag"
This warning is occurring intermittently, I normally run grunt release
but added the --stack
option hoping to find more info.
Before running command, project was at 0.7.0
, why is this error occuring?
rob@work:~/git/project$ grunt release --stack
Running "release" task
>> bumped version of addon/package.json to 0.7.1
>> bumped version of package.json to 0.7.1
>> staged addon/package.json package.json
>> undefined committed
>> created new git tag: 0.7.1
>> pushed to remote
>> pushed new tag 0.7.1 to remote
Warning: Error creating github release. Response: {"message":"Validation Failed","errors":[{"resource":"Release","code":"custom","message":"Published releases must have a valid tag"}],"documentation_url":"https://developer.github.com/v3/repos/releases/#create-a-release"} Use --force to continue.
Aborted due to warnings.
Gruntfile.js
..
release: {
options: {
file: 'package.json',
additionalFiles: ['addon/package.json'],
bump: true,
add: true,
commit: true,
tag: true,
push: true,
pushTags: true,
npm: false,
npmtag: false,
github: {
repo: 'bobbyrne01/project',
usernameVar: 'GITHUB_USERNAME',
passwordVar: 'GITHUB_PASSWORD'
}
}
}
I just had this happen as well. Then I ran it again and all was well. Not sure what the deal is.
The problem is package.json
, addon/package.json
and the tag will still be updated/commited to repo but the release won't be created on github.
If you run grunt release
again, package.json
, addon/package.json
and the tag will again to updated .. basically skipping version number.
I have this issue happen to me as well from time to time, and I have a hunch as to what is causing it... I think it's a race condition between when the tag is pushed to github and when the release API is able to see it. This would explain why rerunning the release task (even with all other steps disabled) results in a successfully created release.
I am going to see if I can think of a way to fix it.
@juliangarritano aah that makes sense. Thanks for looking into it.
I was wondering if you could make an npm package with this fix available? The current version 0.13.0 does not have this fix included.
Will be pulling this in soon, trying to get grunt test task working and dependencies updated, then will be pulling this in. Please stand by...
I googled this error message and found this thread. I am working on a totally separate project and got the same error. Indeed, waiting and then issuing the release fixed it. GitHub must be "eventually consistent."