iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🍕

I built a Go implementation of git-pr-release

に公開

Development Background

git-pr-release is a tool that automatically generates a pull request for a release branch when a git-flow-style release branch exists.
It has convenient features, such as automatically generating links to feature development pull requests included in the release within the description of the release pull request.
Since git-pr-release is implemented in Ruby, it requires installation to use. On GitHub Actions, ruby/setup-ruby can be used. However, to use setup-ruby on a self-hosted runner, Ruby must be pre-installed in the directory pointed to by $RUNNER_TOOL_CACHE.

I felt that the effort of installing Ruby for a development support tool and continuing to maintain that process was not worth the cost, so I created an implementation in Go.

What I Made

https://github.com/odanado/git-pr-release-go

Just like git-pr-release, it automatically generates pull requests as shown in the following image.

While you can download the executable and run the command on your local machine, it is primarily intended for use with GitHub Actions.

Below is a sample workflow file.

name: Create Release Pull Request
on:
  push:
    branches:
      - main

jobs:
  create-release-pr:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - name: Setup git-pr-release-go
        uses: KeisukeYamashita/setup-release@v1.0.2
        with:
          repository: odanado/git-pr-release-go
          arch: x86_64
          platform: Linux

      - run: git-pr-release-go --from main --to release/production
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Finally

As introduced in Achieving one-click deployment with git-pr-release and GitHub Actions | Osaraku wa sore sae mo heibon na hibi, completing a release simply by clicking the pull request merge button is highly convenient and recommended.

If you are interested, please try using git-pr-release-go. Feel free to reach out via GitHub issues or Twitter for any bugs or feature requests.

Discussion