Skip to content

Improve the check-release tag parser to be more robust #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

meili-bot
Copy link
Contributor

This PR is auto-generated.

The automated script generated this PR, which updates the check-release.sh script.

Explaination

check-release.yml used to parse the GITHUB_REF with tr -d 'refs/tags/v'. But, tr deletes characters and not a specific string.
Which results in a wrong parsing of tags containings the characters present in refs/tags/v.
Example:
refs/tags/v0.1.0-strapi-v3.1 becomes 0.1.0-pi-v3.1

To avoid this issue, the command is changed to a more robust parsing method: cut -d '/' -f 3 | sed -r 's/^v//'

  • cut -d '/' -f 3 splits our string based on the / and takes the 3th element.
    refs/tags/v0.1.0-strapi-v3.1 => ["refs", "tags", "v0.1.0-strapi-v3.1"]
  • sed -r 's/^v//' removes the prepending v.
    v0.1.0-strapi-v3.1 => 0.1.0-strapi-v3.1

@meili-bot meili-bot added the skip-changelog The PR will not appear in the release changelogs label Dec 6, 2022
Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

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

bors merge

@bors
Copy link
Contributor

bors bot commented Dec 6, 2022

@bors bors bot merged commit 256553c into main Dec 6, 2022
@bors bors bot deleted the meili-bot/improve-tag-parser-in-check-release branch December 6, 2022 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog The PR will not appear in the release changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants