Skip to content

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Sep 4, 2025

A common pitfall when first setting up craft and our publishing workflow in a new repo is that there's no tag yet in this repo. While this is mentioned as a step in the develop docs, it happens often enough that we don't do it and end up with a less than helpful error in the release preparation flow. This PR simply adds a more descriptive error message so that users have a better idea what to do.

@Lms24 Lms24 self-assigned this Sep 4, 2025
Copy link
Member

@asottile-sentry asottile-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/utils/git.ts Outdated
return (await git.raw('describe', '--tags', '--abbrev=0')).trim();
} catch (e) {
logger.error(
"Couldn't get the latest tag! If you're releasing for the first time, check if your repo contains any tags. If not, add one manually and try again."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps even include the command here? git tag 0.0.0 "$(git log -1 --reverse --format=%h)"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, thanks! 57245bf

@Lms24 Lms24 enabled auto-merge (squash) September 4, 2025 15:23
@Lms24 Lms24 merged commit 307a257 into master Sep 4, 2025
13 checks passed
@Lms24 Lms24 deleted the lms/ref-error-message-git-describe branch September 4, 2025 15:24
@BYK
Copy link
Member

BYK commented Sep 4, 2025

#602 would make this redundant, right? @asottile-sentry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants