Skip to content
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

chore: add workflow to enforce Conventional Commit tags #338

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

ctreatma
Copy link
Contributor

@ctreatma ctreatma commented Aug 30, 2023

Currently our release process is fairly manual: someone with write access to this repo has to check out the latest from main, look at what has changed since the last release, decide on an appropriate new version number, create a git tag in the correct format (is it x.y.z or vx.y.z?), and push that tag back up to GitHub to trigger the release process.

By ensuring that our PR titles have Conventional Commit tags, we make it possible to automatically determine the next release version number, which means we can move to a push-button release process: click the release button, and the workflow does the rest.

This workflow has been in place for some time on metal-go and was recently adopted in metal-java; adopting it more broadly will make it easier for us to safely share the responsibility for releasing our various tools (and could even lead to automated / scheduled release workflows instead of push-button workflows).

@ctreatma
Copy link
Contributor Author

This workflow checks the PR title, not the commit messages, so adding the Conventional Commit tag can be done by editing the PR title without making any changes to the commits in the PRs.

When a PR is opened without Conventional Commit tags, the workflow adds a comment to the PR that explains what the issue is and how to fix it (screenshot below is taken from equinix-labs/metal-go#134:
Screenshot 2023-08-31 at 9 45 02 AM

When the PR title is updated to fix the issue, the comment is deleted. By enforcing tags on the PR titles, we make it possible for internal people to add the necessary tags if, for example, we get a good PR from an external contributor and that contributor is not motivated to add the necessary tag or picks the wrong tag.

@ctreatma ctreatma force-pushed the conventional-commits branch from a7e3ded to 83650b5 Compare August 31, 2023 15:53
@ctreatma ctreatma merged commit 9675ceb into main Sep 8, 2023
@ctreatma ctreatma deleted the conventional-commits branch September 8, 2023 15:23
ocobles pushed a commit that referenced this pull request Nov 10, 2023
Currently our release process is fairly manual: someone with write
access to this repo has to check out the latest from `main`, look at
what has changed since the last release, decide on an appropriate new
version number, create a git tag in the correct format (is it `x.y.z` or
`vx.y.z`?), and push that tag back up to GitHub to trigger the release
process.

By ensuring that our PR titles have Conventional Commit tags, we make it
possible to automatically determine the next release version number,
which means we can move to a push-button release process: click the
release button, and the workflow does the rest.

This workflow has been in place for some time on `metal-go` and was
recently adopted in `metal-java`; adopting it more broadly will make it
easier for us to safely share the responsibility for releasing our
various tools (and could even lead to automated / scheduled release
workflows instead of push-button workflows).
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.

2 participants