Skip to content

Commit 44f821c

Browse files
committed
Update workflows from templates.
1 parent 7102c15 commit 44f821c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/bump-version.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,26 @@ jobs:
6666
git push origin "${{ steps.versions.outputs.release }}"
6767
6868
'
69+
- name: Generate release text
70+
id: release-body
71+
run: "set -x\n# Get the most recent commit. Hopefully it was a PR merge.\nCOMMIT=$(jq\
72+
\ -r '.after' ${{ github.event_path }})\nif [ \"${COMMIT}\" = \"null\" ] ||\
73+
\ [ -z \"${COMMIT}\" ] ; then\n exit 0\nfi\n# Get the most recent PRs; hopefully\
74+
\ ours is one of them.\ncurl -fSs -H \"Accept: application/vnd.github+json\"\
75+
\ \\\n -H \"Authorization: Bearer ${{ secrets.WORKFLOW_PAT }}\" \\\n https://api.github.com/repos/${{\
76+
\ github.repository }}/pulls?state=all\\&base=${{ github.ref }}\\&sort=updated\\\
77+
&direction=desc > /tmp/prs.json\n# Find a PR that resulted in our commit.\n\
78+
PR=$(jq -r \".[] | select(.merge_commit_sha == \\\"${COMMIT}\\\") | .number\"\
79+
\ /tmp/prs.json)\nif [ \"${PR}\" = \"null\" ] || [ -z \"${PR}\" ] ; then\n\
80+
\ exit 0\nfi\n# Build the string we'll use as the description of the release.\n\
81+
echo \"::set-output name=body::latest_pr:${PR}\"\n"
6982
- name: Create prerelease
7083
uses: ncipollo/release-action@v1
7184
with:
7285
token: ${{ secrets.WORKFLOW_PAT }}
7386
prerelease: true
7487
tag: ${{ steps.versions.outputs.release }}
88+
body: ${{ steps.release-body.outputs.body }}
7589
- name: Set development version
7690
run: '.github/bump-version.set.sh "${{ steps.versions.outputs.bumped }}"
7791

0 commit comments

Comments
 (0)