Skip to content

Automate Git Tag Creation with GitHub Actions #899

Closed
@cubxxw

Description

@cubxxw

Background

While working on the OpenIM project, we've faced challenges with the current manual process of tagging our versions. The manual steps we follow are:

tag -a v3.2.0-beta.0 -s -m "release(v3.2.0): new feat cluster"
git push upstream v3.2.0-beta.0

This process has several shortcomings:

  1. Due to our CONTRIBUTING.md guide, direct pushing is not allowed, making this process cumbersome.
  2. Our current PR merge strategy often leads to many commits being merged as one PR, causing verbose and complex commit messages that aren't concise for release notes.
  3. The process is not automated and requires manual effort, which increases the chance of human error.

Proposed Solution: GitHub Action for Tagging

To address these issues, we propose implementing a GitHub action that automates the process of tagging while adhering to our workflow requirements.

Features:

  1. GitOps Integration:
    • If the last digit of the git version number is 0, and there is no build number afterward, it signifies the beginning of a new minor semantic version.
    • The bot will automatically create a branch named release-v*.* and put it under branch protection.
  2. ChatOps Integration:
    • Using GitHub API's labels and PR or issue comment logic, we can command the bot to execute actions.
    • By commenting /content git-tag-name, the bot will automatically tag with the name git-tag-name.
    • Adding a specific label to a PR or issue will prompt the bot to auto-increment the current version number by one on the last digit.

Workflow:

  1. When a PR is merged or an issue is closed, the action checks the version number.
  2. If the last digit is 0, the bot creates a release-v*.* branch and enables branch protection.
  3. Through the comment system (ChatOps), developers can instruct the bot to create specific tags.
  4. Alternatively, specific labels can be used to auto-increment and tag new version numbers.

Benefits:

  • Streamlines the tagging process, making releases more efficient.
  • Reduces human errors.
  • Consistency in tagging and branching.
  • Clear and concise commit messages for release notes.

Next Steps:

  1. Draft a clear specification for the GitHub action, defining all triggers and outputs.
  2. Identify potential challenges in the existing workflow and how this automation might impact them.
  3. Collaborate with team members to gather feedback and iterate on the proposal.

Metadata

Metadata

Assignees

Labels

documentationCategorizes issue or PR as related to documentation.enhancementNew feature or requestfeatureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions