Repository navigation
41 lines (33 loc) · 1.52 KB
/
Copy pathrelease-notes.yml
File metadata and controls
41 lines (33 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Release Notes Publisher
on:
release:
types: 'published'
jobs:
update_release_notes_docs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@master
with:
token: ${{ secrets.RELEASE_NOTES_PAT }}
ref: 'master'
- name: Get Release Info
run: |
curl -s https://api.github.com/repos/meshery/meshery/releases/latest > latest_release.json
export RELEASE_TAG=$( cat latest_release.json | jq '.["tag_name"]' | tr -d '"')
export PRERELEASE=$( cat latest_release.json | jq '.["prerelease"]' | tr -d '"')
export RELEASE_BODY=$( cat latest_release.json | jq '.["body"]' | tr -d '"')
PROCESSED_BODY=$(echo "$RELEASE_BODY" | sed -E 's|(\[)|\\\1|g; s|(\])|\\\1|g')
printf '%b\n' "---\nlayout: release\ndate: $(date +'%Y-%m-%d')\ntag: $RELEASE_TAG\nprerelease: $PRERELEASE\n---\n\n$PROCESSED_BODY" > ./docs/_releases/$RELEASE_TAG.md
- name: Pull changes from remote
run: git pull origin master
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v7
with:
file_pattern: docs
commit_user_name: l5io
commit_user_email: ci@layer5.io
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: '--signoff'
commit_message: '[Docs] Release Notes for Meshery ${{ steps.release_drafter.outputs.tag_name }}'
branch: master