2024-03-04 03:54:13 +00:00
|
|
|
name: "Release Manager: sync changelog with PR"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-07-09 07:08:49 +00:00
|
|
|
- develop
|
2024-03-04 03:54:13 +00:00
|
|
|
paths:
|
|
|
|
- 'CHANGELOG.md'
|
2024-07-14 08:27:27 +00:00
|
|
|
# - .github/workflows/release-edit-with-push.yml
|
2024-03-04 03:54:13 +00: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 07:08:49 +00:00
|
|
|
# headが$GITHUB_REF_NAME, baseが$STABLE_BRANCHかつopenのPRを1つ取得
|
2024-03-04 03:54:13 +00:00
|
|
|
- name: Get PR
|
|
|
|
run: |
|
2024-07-09 07:08:49 +00: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 03:54:13 +00:00
|
|
|
id: get_pr
|
2024-07-09 07:08:49 +00:00
|
|
|
env:
|
|
|
|
STABLE_BRANCH: ${{ vars.STABLE_BRANCH }}
|
2024-03-04 03:54:13 +00:00
|
|
|
- name: Get target version
|
2024-07-11 07:39:06 +00:00
|
|
|
if: steps.get_pr.outputs.pr_number != ''
|
2024-07-09 07:08:49 +00:00
|
|
|
uses: misskey-dev/release-manager-actions/.github/actions/get-target-version@v2
|
2024-03-04 03:54:13 +00:00
|
|
|
id: v
|
|
|
|
# CHANGELOG.mdの内容を取得
|
|
|
|
- name: Get changelog
|
2024-07-11 07:39:06 +00:00
|
|
|
if: steps.get_pr.outputs.pr_number != ''
|
2024-07-09 07:08:49 +00:00
|
|
|
uses: misskey-dev/release-manager-actions/.github/actions/get-changelog@v2
|
2024-03-04 03:54:13 +00:00
|
|
|
with:
|
|
|
|
version: ${{ steps.v.outputs.target_version }}
|
|
|
|
id: changelog
|
|
|
|
# PRのnotesを更新
|
|
|
|
- name: Update PR
|
2024-07-11 07:39:06 +00:00
|
|
|
if: steps.get_pr.outputs.pr_number != ''
|
2024-03-04 03:54:13 +00:00
|
|
|
run: |
|
2024-05-27 11:11:39 +00:00
|
|
|
gh pr edit "$PR_NUMBER" --body "$CHANGELOG"
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{ steps.get_pr.outputs.pr_number }}
|
2024-07-09 07:08:49 +00:00
|
|
|
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
|