kellnr_release_notes #19
This file contains hidden or 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: Changelog Dispatch PR | |
| on: | |
| repository_dispatch: | |
| types: | |
| - kellnr_release_notes | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: changelog-dispatch-pr | |
| cancel-in-progress: false | |
| jobs: | |
| create-changelog-pr: | |
| name: Create PR for changelog.json update | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Update changelog.json from dispatch payload | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| python3 .github/scripts/apply_release_notes_to_changelog.py \ | |
| --payload-stdin \ | |
| --changelog-json src/data/changelog.json <<'PAYLOAD' | |
| ${{ toJson(github.event.client_payload) }} | |
| PAYLOAD | |
| - name: Generate PR body summary | |
| id: pr_body | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| { | |
| echo "body<<EOF" | |
| python3 .github/scripts/apply_release_notes_to_changelog.py \ | |
| --payload-stdin \ | |
| --print-summary \ | |
| --dry-run \ | |
| --changelog-json src/data/changelog.json <<'PAYLOAD' | |
| ${{ toJson(github.event.client_payload) }} | |
| PAYLOAD | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Create pull request | |
| id: cpr | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: "chore(changelog): add release ${{ github.event.client_payload.version }}" | |
| branch: "automation/changelog-${{ github.event.client_payload.version }}" | |
| delete-branch: true | |
| title: "Changelog: release ${{ github.event.client_payload.version }}" | |
| body: ${{ steps.pr_body.outputs.body }} | |
| - name: Summary | |
| if: always() | |
| shell: bash | |
| run: | | |
| echo "PR URL: ${{ steps.cpr.outputs.pull-request-url }}" | |
| echo "PR number: ${{ steps.cpr.outputs.pull-request-number }}" |