On Misskey Release (Update Release Notes) #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: On Misskey Release (Update Release Notes) | |
on: | |
repository_dispatch: | |
types: [misskey_release] | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Latest version of Misskey' | |
required: false | |
releaseDate: | |
description: 'Release date (YYYY-MM-DD)' | |
required: false | |
env: | |
TZ: Asia/Tokyo | |
VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }} | |
RELEASE_DATE: ${{ github.event.client_payload.releaseDate || github.event.inputs.releaseDate }} | |
jobs: | |
update-release-notes: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
- run: corepack enable | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm install --frozen-lockfile | |
working-directory: scripts/changelog-auto-updater | |
- run: pnpm start | |
working-directory: scripts/changelog-auto-updater | |
- name: Check diff | |
id: diff | |
run: | | |
git add -N . | |
git diff --name-only --exit-code | |
continue-on-error: true | |
- name: Commit changes | |
if: steps.diff.outcome == 'failure' | |
run: | | |
set -x | |
git checkout -b update-release-notes-${{ env.VERSION || 'latest' }} | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git add . | |
git commit -m "docs: Update release notes for ${{ env.VERSION || 'latest' }} release" | |
git push | |
- name: Create Pull Request | |
if: steps.diff.outcome == 'failure' | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: | | |
gh pr create --draft --title "Update release notes (${{ env.VERSION != null && env.VERSION || 'latest' }})" --base master --head update-release-notes-${{ env.VERSION != null && env.VERSION || 'latest' }} |