-
Notifications
You must be signed in to change notification settings - Fork 0
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
Multilabel #7
base: alpha
Are you sure you want to change the base?
Multilabel #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ednark I've just reviewed the changes and added some comments. Once we address those, I think we are good to merge this and test it with the dev release in our projects.
NAT='0|[1-9][0-9]*' | ||
SEMVER_REGEX="\ | ||
^[vV]?\ | ||
^([vV]?\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here we are missing the closing parenthesis for this group?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, and also in here: I think we can replace that hardcoded "vV" with the $PREFIX env var that we are sending to this step
- run:
name: PR Semantic Versioning
environment:
SHA: $CIRCLE_SHA1
USER: << parameters.git-username >>
PREFIX: << parameters.tag-prefix >>
command: <<include(scripts/export-tag.sh)>>
So we would endup with something like:
SEMVER_REGEX="\
^(${PREFIX}?)\
($NAT)\\.($NAT)\\.($NAT)$"
LABEL="patch" | ||
fi | ||
# select all the labels of this PR | ||
LABELS=$(curl -s -X GET -H "Authorization: token $GIT_USER_TOKEN" https://api.github.com/repos/"$REPO_NAME"/issues/"$PR_NUMBER"/labels | jq .[].name -r | grep -Ei "^(major|minor|patch)$" | tr '[:upper:]' '[:lower:]' | tr "\n" " ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the github enpoint I think we are missing the repo owner. https://docs.github.com/en/rest/reference/repos#get-a-repository like:
https://api.github.com/repos/"$REPO_OWNER"/"$REPO_NAME"/issues/"$PR_NUMBER"/labels
We can get the repository owner/organization with the cicrcleci env var: $CIRCLE_PROJECT_USERNAME
attempt to take into account multiple labels and use prefix from regex