grunt-release icon indicating copy to clipboard operation
grunt-release copied to clipboard

'Warning: Error creating github release.', "Published releases must have a valid tag"

Open bobbyrne01 opened this issue 9 years ago • 7 comments

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'
        }
    }
}

bobbyrne01 avatar Jan 11 '15 23:01 bobbyrne01

I just had this happen as well. Then I ran it again and all was well. Not sure what the deal is.

scottux avatar Feb 04 '15 16:02 scottux

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.

bobbyrne01 avatar Feb 04 '15 19:02 bobbyrne01

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.

jugarrit avatar May 28 '15 19:05 jugarrit

@juliangarritano aah that makes sense. Thanks for looking into it.

geddski avatar Jul 06 '15 06:07 geddski

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.

bemisguided avatar Jan 13 '16 17:01 bemisguided

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...

dorgan avatar Apr 30 '16 17:04 dorgan

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."

mholt avatar Dec 20 '16 06:12 mholt