-
Notifications
You must be signed in to change notification settings - Fork 56
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
[CI/CD] auto-tag main on merge #1126
base: main
Are you sure you want to change the base?
[CI/CD] auto-tag main on merge #1126
Conversation
Need to filter out only if |
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.
Some bash nits and 1 important git tag
thingy
.github/workflows/tag-main.yml
Outdated
echo "Version has not changed. Skipping tagging." | ||
exit 0 | ||
fi | ||
git tag "v${current_tag}" |
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.
For releases, tags should always be verbosely annotated
git tag "v${current_tag}" | |
LATEST_COMMIT_MESSAGE=$(git log -1 --pretty=format:%s) | |
git tag -a "v${current_tag}" -m "${LATEST_COMMIT_MESSAGE}" |
.github/workflows/tag-main.yml
Outdated
run: | | ||
# Get the current version from pyproject.toml | ||
CURRENT_TAG=$(grep -E '^version = ".*"' pyproject.toml | cut -d'"' -f2) | ||
echo "current_tag=$CURRENT_TAG" >> $GITHUB_ENV |
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.
echo "current_tag=$CURRENT_TAG" >> $GITHUB_ENV | |
echo "current_tag=${CURRENT_TAG}" >> $GITHUB_ENV |
.github/workflows/tag-main.yml
Outdated
run: | | ||
# Get the version from the previous commit for comparison | ||
PREV_TAG=$(git show HEAD~1:pyproject.toml | grep -E '^version = ".*"' | cut -d'"' -f2) | ||
echo "prev_tag=$PREV_TAG" >> $GITHUB_ENV |
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.
echo "prev_tag=$PREV_TAG" >> $GITHUB_ENV | |
echo "prev_tag=${PREV_TAG}" >> $GITHUB_ENV |
.github/workflows/tag-main.yml
Outdated
|
||
- name: Tag main | ||
run: | | ||
if [ "$current_tag" == "$prev_tag" ]; then |
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.
if [ "$current_tag" == "$prev_tag" ]; then | |
if [ "${current_tag}" == "${prev_tag}" ]; then |
Description
What - automate tagging main branch
Why - it's annoying to redo it manually each time
How - using github action
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examples
folder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.