0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【GitHub】プルリクエストのタイトルがConventional Commitsに則っているか検証する方法

Posted at

action-semantic-pull-requestを使用してプルリクエストのタイトルがConventional Commitsに則っているのか検証できます。

導入方法

.github/workflows/semantic-pull-request.ymlを以下の内容で作成します。

.github/workflows/semantic-pull-request.yml
name: "Lint PR"

on:
  pull_request:
    types:
      - opened
      - edited
      - synchronize

permissions:
  pull-requests: read

jobs:
  main:
    name: Validate PR title
    runs-on: ubuntu-latest
    steps:
      - uses: amannn/action-semantic-pull-request@v5
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

プルリクエストのタイトルをコミットメッセージのタイトルにするため、リポジトリのSettings > General > Pull RequestsでAllow squash mergingにチェックを入れ、Default commit messageをPull request titleに変更します。

スクリーンショット 2024-07-19 23.52.36.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?