Skip to content

Commit

Permalink
CI: comment back on the version bump PR after drafting a release (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Aug 26, 2023
1 parent 74ce5a5 commit 8fd1ddd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/gh-release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,26 @@ jobs:
echo ""
echo "${{ steps.release-drafter.outputs.html_url }}"
} >> "${GITHUB_STEP_SUMMARY}"
# Comment back on the PR that caused this release
- if: ${{ steps.release-drafter.outputs.id }}
id: pr-finder
run: |
GIT_SHA=$(git rev-parse HEAD)
PR_NUMBER=$(curl -L \
--fail-with-body \
--silent \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/commits/${GIT_SHA}/pulls" \
| jq --raw-output '.[0].number')
echo "PR_NUMBER=${PR_NUMBER}" >> "${GITHUB_OUTPUT}"
- if: ${{ steps.release-drafter.outputs.id }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
## :shipit: New Release
This pull request resulted in the release: [v${{ steps.check.outputs.version }} @ ${{ env.ref }}](${{ steps.release-drafter.outputs.html_url }})
comment_tag: gh-release
pr_number: ${{ steps.pr-finder.outputs.PR_NUMBER }}

0 comments on commit 8fd1ddd

Please sign in to comment.