LoginSignup
17
8

More than 3 years have passed since last update.

Github Actionsでgitのブランチ運用ルール違反に気付きやすくする

Posted at

はじめに

本番リリース用ブランチへのマージ前に、検証用ブランチにマージして動作確認するという運用ルールになっているケースは比較的多いかと思います。
しかし本番リリース用ブランチへのPR時に、本当に検証用ブランチにマージ済みかどうかレビューでチェックという運用だと見逃しが発生する可能性があるし面倒ですよね。
そんな不便を解消するために作ったアクションを紹介します。

何が出来るの?

pull_requestイベントのアクションとして実行することで、指定ブランチにマージされていなかったらコメントで指摘してくれるようになります。

Demo

使い方

masterブランチへのPR時に必ずstagingブランチにマージされていることを検証したい場合の設定例。

name: Check merged
on:
  pull_request:
    branches:
      - master

jobs:
  check-staging:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - uses: SonicGarden/check-merged-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          originBranch: staging

Marketplace

Check merged · Actions · GitHub Marketplace

良かったら使ってみてください。

17
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
8