| # 1. Generates release notes using github API. |
| # 2. Strips unnecessary info like chore/style etc from notes. |
| # 3. Updates release info. |
| # This action needs to be maintained on all branches that do releases. |
| description: 'Tag of release like v13.0.0' |
| name: 'Regenerate release notes' |
| 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' ) |
| RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/tags/$RELEASE_TAG | jq -r '.id') |
| gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/$RELEASE_ID -f body="$NEW_NOTES" |
| GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} |
| RELEASE_TAG: ${{ github.event.inputs.tag_name || github.event.release.tag_name }} |