Repository navigation
ci: reply in Nick Fury's thread when a release-notes PR closes [ZGA-696] #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nishithatanukunuri
merged 1 commit into
main
from
ci/ZGA-696-release-notes-pr-slack-reply
Nov 12, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: Release notes PR closed | ||
|
|
||
| # SDK releases open release-notes/<sdk>-<version> PRs here (zerogpu/release-notes-action sdk-docs) | ||
| # and announce them in #nick-fury-gtm as Nick Fury. When one is merged or closed, this replies in | ||
| # that announcement's thread, found from the `slack=<channel>:<ts>` key in the PR body's marker. | ||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| reply: | ||
| if: ${{ startsWith(github.head_ref, 'release-notes/') && github.event.pull_request.head.repo.full_name == github.repository }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Reply in the announcement thread | ||
| env: | ||
| SLACK_BOT_TOKEN: ${{ secrets.NICKFURY_SLACK_BOT_TOKEN }} | ||
| PR_BODY: ${{ github.event.pull_request.body }} | ||
| PR_TITLE: ${{ github.event.pull_request.title }} | ||
| MERGED: ${{ github.event.pull_request.merged }} | ||
| MERGED_BY: ${{ github.event.pull_request.merged_by.login }} | ||
| run: | | ||
| if [[ ! "$PR_BODY" =~ nick-fury:sdk-release[^\>]*slack=([A-Z0-9]+):([0-9.]+) ]]; then | ||
| echo "::notice::No Slack thread recorded in the PR body; nothing to reply to." | ||
| exit 0 | ||
| fi | ||
| channel="${BASH_REMATCH[1]}"; ts="${BASH_REMATCH[2]}" | ||
| release="${PR_TITLE#docs(release-notes): }" | ||
| release="${release//&/&}"; release="${release//</<}"; release="${release//>/>}" | ||
| if [ "$MERGED" = "true" ]; then | ||
| text=":white_check_mark: Merged${MERGED_BY:+ by $MERGED_BY}. $release will be on <https://docs.zerogpu.ai/edge/release-notes|the release notes> once the docs finish deploying." | ||
| else | ||
| text="Closed without merging, so $release isn't in the release notes." | ||
| fi | ||
| jq -n --arg channel "$channel" --arg ts "$ts" --arg text "$text" \ | ||
| '{channel: $channel, thread_ts: $ts, text: $text, unfurl_links: false}' \ | ||
| | curl -sS https://slack.com/api/chat.postMessage \ | ||
| -H "Authorization: Bearer $SLACK_BOT_TOKEN" \ | ||
| -H 'Content-Type: application/json; charset=utf-8' \ | ||
| --data @- \ | ||
| | jq -e '.ok' > /dev/null || { echo "::error::Slack did not accept the reply"; exit 1; } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Escape the replacement ampersands.
Bash enables
patsub_replacementby default. An unquoted replacement&expands to the matched text. Thus,SDK <preview>becomesSDK <lt;preview>gt;, not the intended escaped title. Escape each replacement ampersand. (gnu.org)Proposed fix
Committable suggestion