Skip to content

thaim/actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

131 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thaim/actions

複数リポジトリで共用する Composite Actions と Reusable Workflows を管理するリポジトリ。

Reusable Workflows

Release Flow

reusable-conventional-prreusable-release はペアで利用することを前提とした reusable workflow です。前者が PR title の conventional commit 形式を検証して対応ラベル(enhancement / bug 等)を付与し、後者の tagpr がそのラベルと PR title を用いて version bump 判定と CHANGELOG 生成を行います。reusable-release を採用する場合は reusable-conventional-pr も併せて導入してください(ラベルが付かないと tagpr の version bump 判定が機能しません)。

reusable-conventional-pr

PR に対して conventional commit 規約の準拠を保証する reusable workflow です。PR title を amannn/action-semantic-pull-request で検証し、title の type に対応するラベルを thaim/actions/actions/sync-pr-labels で付与します。reusable-release とペアで運用する前提です(詳細は上記 Release Flow を参照)。 デフォルトで対応する type は feat, fix, ci, docs, refactor, chore で、それぞれ enhancement, bug, ci, documentation, refactor, chore ラベルにマッピングされます。

name: Conventional PR

on:
  pull_request:
    types: [opened, edited, synchronize]

jobs:
  conventional-pr:
    uses: thaim/actions/.github/workflows/reusable-conventional-pr.yml@v1.0.2

許可する type やラベルマッピングをカスタマイズする場合は types / type_labels を指定します。types に追加した type は、other ラベル付与を避けるため type_labels にも同じキーを追加してください。

jobs:
  conventional-pr:
    uses: thaim/actions/.github/workflows/reusable-conventional-pr.yml@v1.0.2
    with:
      types: |
        feat
        fix
        perf
      type_labels: |
        {
          "feat": "enhancement",
          "fix": "bug",
          "perf": "performance"
        }
入力 必須 デフォルト 説明
types no feat, fix, ci, docs, refactor, chore(改行区切り) 許可する conventional commit type の一覧
type_labels no 上記 type → 対応ラベルの JSON マッピング type → ラベル名のマッピング(JSON 文字列)

reusable-release

Songmu/tagpr によるリリースフローを提供します。main ブランチへの push 時にリリース PR を自動作成し、リリース PR がマージされると自動的にタグを付与します。version bump の判定や CHANGELOG 生成は PR に付与されたラベルと PR title を参照するため、reusable-conventional-pr とペアで運用してください(詳細は上記 Release Flow を参照)。

リリース PR (branch 名が tagpr-from- で始まる PR) に tagpr:major または tagpr:minor ラベルを付与すると workflow が再実行され、version bump が再計算されます。これを有効化するには呼び出し側で pull_request: types: [labeled, unlabeled] を on に追加してください。

name: Release

on:
  push:
    branches: [main]
  pull_request:
    types: [labeled, unlabeled]

jobs:
  release:
    uses: thaim/actions/.github/workflows/reusable-release.yml@v1.0.2

reusable-gha-security

GitHub Actions ワークフローに対して actionlintghalintzizmor によるセキュリティチェックを実行します。 PRでは reviewdog によるインラインコメントで問題箇所を通知します。

name: Security

on:
  push:
    branches: [main]
  pull_request:

jobs:
  security:
    uses: thaim/actions/.github/workflows/reusable-gha-security.yml@v1.0.2

Development

Composite action を変更する際は、composite action 修正の PR と reusable workflow 内の SHA 更新の PR を分けて作成する。詳細は CLAUDE.md #開発フロー を参照。

License

MIT

About

Reusable GitHub Actions workflows and composite actions

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors