2024-03-04 12:54:13 +09:00
|
|
|
name: "Release Manager: sync changelog with PR"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-07-09 16:08:49 +09:00
|
|
|
- develop
|
2024-03-04 12:54:13 +09:00
|
|
|
paths:
|
|
|
|
- 'CHANGELOG.md'
|
2024-08-09 12:05:28 +09:00
|
|
|
|
2024-03-04 12:54:13 +09:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
issues: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
edit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-07-09 16:08:49 +09:00
|
|
|
# headが$GITHUB_REF_NAME, baseが$STABLE_BRANCHかつopenのPRを1つ取得
|
2024-03-04 12:54:13 +09:00
|
|
|
- name: Get PR
|
|
|
|
run: |
|
2024-07-09 16:08:49 +09:00
|
|
|
echo "pr_number=$(gh pr list --limit 1 --search "head:$GITHUB_REF_NAME base:$STABLE_BRANCH is:open" --json number --jq '.[] | .number')" >> $GITHUB_OUTPUT
|
2024-03-04 12:54:13 +09:00
|
|
|
id: get_pr
|
2024-07-09 16:08:49 +09:00
|
|
|
env:
|
|
|
|
STABLE_BRANCH: ${{ vars.STABLE_BRANCH }}
|
2024-03-04 12:54:13 +09:00
|
|
|
- name: Get target version
|
2024-07-11 16:39:06 +09:00
|
|
|
if: steps.get_pr.outputs.pr_number != ''
|
2024-07-09 16:08:49 +09:00
|
|
|
uses: misskey-dev/release-manager-actions/.github/actions/get-target-version@v2
|
2024-03-04 12:54:13 +09:00
|
|
|
id: v
|
|
|
|
# CHANGELOG.mdの内容を取得
|
|
|
|
- name: Get changelog
|
2024-07-11 16:39:06 +09:00
|
|
|
if: steps.get_pr.outputs.pr_number != ''
|
2024-07-09 16:08:49 +09:00
|
|
|
uses: misskey-dev/release-manager-actions/.github/actions/get-changelog@v2
|
2024-03-04 12:54:13 +09:00
|
|
|
with:
|
|
|
|
version: ${{ steps.v.outputs.target_version }}
|
|
|
|
id: changelog
|
|
|
|
# PRのnotesを更新
|
|
|
|
- name: Update PR
|
2024-07-11 16:39:06 +09:00
|
|
|
if: steps.get_pr.outputs.pr_number != ''
|
2024-03-04 12:54:13 +09:00
|
|
|
run: |
|
2024-05-27 20:11:39 +09:00
|
|
|
gh pr edit "$PR_NUMBER" --body "$CHANGELOG"
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{ steps.get_pr.outputs.pr_number }}
|
2024-07-09 16:08:49 +09:00
|
|
|
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
|