platform-release #33
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
| # Receives platform-release dispatch and opens an editorial PR adding the new | |
| # version to the top of the release-notes page (RELEASE-PROCESS-PLAN.md §5.4). | |
| name: changelog-sync | |
| on: | |
| repository_dispatch: | |
| types: [platform-release] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| open-changelog-pr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # App token (not GITHUB_TOKEN): the org forbids Actions from creating PRs | |
| # with GITHUB_TOKEN, and App-minted tokens are exempt. Scoped to this repo. | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.RELEASE_BOT_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Generate changelog entry | |
| env: | |
| VERSION: ${{ github.event.client_payload.version }} | |
| BODY_B64: ${{ github.event.client_payload.release_body_b64 }} | |
| run: | | |
| set -eu | |
| printf '%s' "$BODY_B64" | base64 -d > /tmp/release-body.md | |
| node scripts/changelog-from-release.mjs "$VERSION" /tmp/release-body.md src/pages/docs/release-notes.mdx | |
| - name: Open PR | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| VERSION: ${{ github.event.client_payload.version }} | |
| RELEASE_URL: ${{ github.event.client_payload.release_url }} | |
| run: | | |
| set -eu | |
| branch="chore/changelog-${VERSION}" | |
| git config user.name "futureagi-release-bot" | |
| git config user.email "release-bot@futureagi.com" | |
| git switch -c "$branch" | |
| git add src/pages/docs/release-notes.mdx | |
| git commit -m "docs(release-notes): add ${VERSION}" | |
| git push origin "$branch" | |
| gh pr create --base main --head "$branch" \ | |
| --title "docs(release-notes): ${VERSION}" \ | |
| --body "Auto-generated from the [${VERSION} release notes](${RELEASE_URL}). Edit for a product audience before merging — rewrite or drop raw commit bullets; merging as-is is acceptable." |