staging ブランチから production ブランチへのリリースPRを自動作成するComposite Actionです。 git-pr-release を使用して、リリースに含まれるPR一覧をチェックリスト形式で本文に含んだPRを作成します。
- uses: buffett-code-dev/github-actions/github/git-pr-release@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch-production: main
branch-staging: develop| 名前 | 必須 | デフォルト | 説明 |
|---|---|---|---|
github-token |
Yes | GitHubトークン (pull request write権限が必要) | |
branch-production |
Yes | 本番ブランチ名 | |
branch-staging |
Yes | ステージングブランチ名 | |
labels |
release |
リリースPRに付与するラベル (カンマ区切り) | |
template |
リリースPR本文のERBテンプレートファイルのパス |
name: Create release PR
on:
schedule:
- cron: '0 0 * * 1' # 毎週月曜0時に実行
workflow_dispatch:
jobs:
release-pr:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: buffett-code-dev/github-actions/github/git-pr-release@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch-production: main
branch-staging: develop- uses: buffett-code-dev/github-actions/github/git-pr-release@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch-production: master
branch-staging: development- uses: buffett-code-dev/github-actions/github/git-pr-release@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch-production: main
branch-staging: develop
labels: release,hotfixname: Create release PR
on:
push:
branches:
- develop
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
release-pr:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: buffett-code-dev/github-actions/github/git-pr-release@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch-production: main
branch-staging: develop- production ブランチと staging ブランチの差分を確認します
- 差分がない場合はスキップします
- 差分がある場合、staging → production のリリースPRを作成 (既存のリリースPRがあれば更新) します
- リリースPRの本文には、含まれるPRの一覧がチェックリスト形式で記載されます
actions/checkoutでfetch-depth: 0を指定して全履歴を取得すること- ワークフローが
pull-requests: write権限を持っていること