Skip to content

Commit 1fbf30b

Browse files
committed
add release notes to github pages
1 parent 693bca9 commit 1fbf30b

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/tag-release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,48 @@ jobs:
357357
358358
It was initialized by [${{ github.event.sender.login }}](${{ github.event.sender.html_url }})
359359
360+
- name: Checkout gh-pages branch
361+
if: ${{ !inputs.dry_run }}
362+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
363+
with:
364+
repository: ${{ github.repository }}
365+
ref: gh-pages
366+
path: gh-pages
367+
368+
- name: Publish release notes to gh-pages
369+
if: ${{ !inputs.dry_run }}
370+
working-directory: gh-pages
371+
env:
372+
RELEASE_ID: ${{ steps.get_release.outputs.id }}
373+
VERSION_TAG: ${{ steps.output_version_tag.outputs.VERSION_TAG }}
374+
GH_REPO: ${{ github.repository }}
375+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
376+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
377+
run: |
378+
set -euo pipefail
379+
notes_dir="release_notes"
380+
mkdir -p "$notes_dir"
381+
note_file="$notes_dir/${VERSION_TAG}.md"
382+
383+
gh api "/repos/${GH_REPO}/releases/${RELEASE_ID}" | jq -r '.body // ""' > "$note_file"
384+
385+
if [ ! -s "$note_file" ]; then
386+
echo "Release notes are empty; skipping gh-pages update."
387+
exit 0
388+
fi
389+
390+
git config user.name "github-actions[bot]"
391+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
392+
393+
git add "$note_file"
394+
if git diff --cached --quiet; then
395+
echo "No changes detected in release notes; skipping commit."
396+
exit 0
397+
fi
398+
399+
git commit -m "docs: add release notes for ${VERSION_TAG}"
400+
parallel --retries 10 --delay 3 ::: "git pull --rebase && git push"
401+
360402
- name: Output Change Set Version
361403
id: output_change_set_version
362404
shell: bash

0 commit comments

Comments
 (0)