You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh release create: Fail when there are no new commits since the most recent release #6059
Describe the feature or problem you’d like to solve
Currently gh release create succeeds when there have been no new commits since the most recent release, creating a duplicate release. I would like gh release create to (optionally) fail when there have been no new commits since the most recent release.
Proposed solution
Add a new option that causes gh release create to fail when there have been no new commits since the most recent release.
Context
I created a duplicate release unintentionally when I hadn't noticed that there had been no new commits since the last release.
I now use a schedule GitHub action to create a new prerelease each night. It would create a duplicate release if there had been no new commits since the previous day.
Workaround
git fetch origin tag $(gh release list -L1 | cut -f1)if git describe --tags --exact-match origin/master;thenecho'Error: No new commits since the most recent release'exit 1
else
gh release create --prerelease --generate-notes $(date +%Y.%m.%d)fi
I definitely see the merit in this; I can definitely think of times when someone might want to create a duplicate release -- to re-trigger an asset build, for example.
I support adding a new flag to gh release create. Off the top of my head, --only-new, but I'm open to suggestion there.
Activity
vilmibm commentedon Aug 11, 2022
I definitely see the merit in this; I can definitely think of times when someone might want to create a duplicate release -- to re-trigger an asset build, for example.
I support adding a new flag to
gh release create. Off the top of my head,--only-new, but I'm open to suggestion there.I'll open this up for a PR.