DEV Community

Cover image for Github Action Go Git Commit Action
somaz
somaz

Posted on

Github Action Go Git Commit Action

Go Git Commit Action

GitHub Marketplace


Introducing Go Git Commit Action

Hello DEV Community! πŸ‘‹

I'm excited to share a GitHub Action I've developed that might make your CI/CD workflows a bit smoother: Go Git Commit Action.


What is it?

Go Git Commit Action is a GitHub Action written in Go that automates git operations in your workflows. It handles commits, pushes, tags, and even pull request creation - all in one action.


Why I built it

While there are several git automation actions available, I wanted something:

  • Written in Go for better performance
  • Combining multiple git operations in one action
  • Providing flexible options for different workflows
  • Handling edge cases like empty commits and reference tags

Key Features

  • Automated Git Operations: Commit, push, and tag in one step
  • Pull Request Management: Create PRs with custom titles, labels, and auto-branch generation
  • Tag Management: Create, delete, and reference tags
  • Performance: Written in Go for efficiency
  • Flexibility: Configurable for various workflows

Example Usage

Basic Commit

- uses: somaz94/go-git-commit-action@v1
  with:
    user_email: actions@github.com
    user_name: GitHub Actions
    commit_message: Auto commit by GitHub Actions
    branch: main
Enter fullscreen mode Exit fullscreen mode

Creating a Tag

- uses: somaz94/go-git-commit-action@v1
  with:
    user_email: actions@github.com
    user_name: GitHub Actions
    tag_name: v1.0.0
    tag_message: Release version 1.0.0
Enter fullscreen mode Exit fullscreen mode

Creating a Pull Request

- uses: somaz94/go-git-commit-action@v1
  with:
    user_email: actions@github.com
    user_name: GitHub Actions
    create_pr: true
    pr_branch: feature/my-branch
    pr_base: main
    pr_title: "feat: my custom PR title"
    pr_labels: "enhancement,automated"
    github_token: ${{ secrets.GITHUB_TOKEN }}
Enter fullscreen mode Exit fullscreen mode

Why You Might Like It

  • Simplify Workflows: Combine multiple git steps into one
  • Reduce Boilerplate: Less YAML in your workflow files
  • Flexible Options: Configure only what you need
  • Reliable Execution: Written in Go for consistent performance

Get Started

You can find the action in the GitHub Marketplace or check out the repository for more examples and documentation.

I'd love to hear your feedback or feature requests! Feel free to open issues or contribute to the project.

Happy automating! πŸš€

Top comments (0)