blob: e765a66f691fa185fde45e13322489d2443cb057 [file] [log] [blame]
Ankush Menat0340bfc2023-07-12 12:17:20 +05301# This action:
2#
3# 1. Generates release notes using github API.
4# 2. Strips unnecessary info like chore/style etc from notes.
5# 3. Updates release info.
6
7# This action needs to be maintained on all branches that do releases.
8
9name: 'Release Notes'
10
11on:
12 workflow_dispatch:
13 inputs:
14 tag_name:
15 description: 'Tag of release like v13.0.0'
16 required: true
17 type: string
18 release:
19 types: [released]
20
21permissions:
22 contents: read
23
24jobs:
25 regen-notes:
26 name: 'Regenerate release notes'
27 runs-on: ubuntu-latest
28
29 steps:
30 - name: Update notes
31 run: |
Ankush Menatb5f6a1c2023-07-13 21:03:46 +053032 NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/generate-notes -f tag_name=$RELEASE_TAG | jq -r '.body' | sed -E '/^\* (chore|ci|test|docs|style)/d' )
33 RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/tags/$RELEASE_TAG | jq -r '.id')
34 gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/$RELEASE_ID -f body="$NEW_NOTES"
Ankush Menat0340bfc2023-07-12 12:17:20 +053035
36 env:
37 GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
38 RELEASE_TAG: ${{ github.event.inputs.tag_name || github.event.release.tag_name }}