Skip to content

Commit 1abec41

Browse files
feat(cicd): Add Slack message on Manual SDK Release (#35461)
Here are examples of the types of messages --- Auto-publish — next (PR merge) ▎ 🟠 Attention dotters: SDK libs (Angular, Client, Experiments and React) published! ▎ ▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 1.5.1-next.1965 (next) ] is now available on the NPM registry 📦! ▎ Introduced by: [#35412](#35412) --- Manual release — patch ▎ 🟢 Attention dotters: SDK libs (Angular, Client, Experiments and React) officially released! ▎ ▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 1.5.2 (latest) and 1.5.2-next.1966 (next) ] is now available on the NPM registry 📦! ▎ Release type: patch | Triggered by: kevindavila ▎ [View workflow run](https://github.com/dotcms/core/actions/runs/12345678) --- Manual release — minor ▎ 🟢 Attention dotters: SDK libs (Angular, Client, Experiments and React) officially released! ▎ ▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 1.6.0 (latest) and 1.6.0-next.1970 (next) ] is now available on the NPM registry 📦! ▎ Release type: minor | Triggered by: kevindavila ▎ [View workflow run](https://github.com/dotcms/core/actions/runs/12345678) --- Manual release — major ▎ 🟢 Attention dotters: SDK libs (Angular, Client, Experiments and React) officially released! ▎ ▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 2.0.0 (latest) and 2.0.0-next.1975 (next) ] is now available on the NPM registry 📦! ▎ Release type: major | Triggered by: kevindavila ▎ [View workflow run](https://github.com/dotcms/core/actions/runs/12345678) --- Manual release — custom ▎ 🟢 Attention dotters: SDK libs (Angular, Client, Experiments and React) officially released! ▎ ▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 1.5.3 (latest) and 1.5.3-next.1980 (next) ] is now available on the NPM registry 📦! ▎ Release type: custom | Triggered by: kevindavila ▎ [View workflow run](https://github.com/dotcms/core/actions/runs/12345678) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a1330dd commit 1abec41

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/cicd_comp_deployment-phase.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,33 @@ jobs:
368368
> `npm i -g @dotcms/dotcli@${{ steps.cli_publish.outputs.npm-package-version-tag }}`
369369
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
370370

371+
# Extract PR info from the merge commit message for SDK notification
372+
- name: Extract PR from commit message
373+
id: pr_info
374+
if: success() && steps.sdks_publish.outputs.published == 'true'
375+
env:
376+
COMMIT_MSG: ${{ github.event.head_commit.message }}
377+
run: |
378+
PR_NUMBER=$(echo "$COMMIT_MSG" | grep -oP '#\K[0-9]+' | head -1 || true)
379+
if [ -n "$PR_NUMBER" ]; then
380+
echo "pr_url=${{ github.server_url }}/${{ github.repository }}/pull/$PR_NUMBER" >> $GITHUB_OUTPUT
381+
echo "pr_ref=#${PR_NUMBER}" >> $GITHUB_OUTPUT
382+
else
383+
echo "pr_url=${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}" >> $GITHUB_OUTPUT
384+
echo "pr_ref=$(echo '${{ github.sha }}' | cut -c1-7)" >> $GITHUB_OUTPUT
385+
fi
386+
shell: bash
387+
371388
# Send Slack notification for SDK publication (if required)
372389
- name: Slack Notification (SDK announcement)
373390
if: success() && steps.sdks_publish.outputs.published == 'true'
391+
continue-on-error: true
374392
uses: ./.github/actions/core-cicd/notification/notify-slack
375393
with:
376394
channel-id: "log-sdk-libs"
377395
payload: |
378396
> :large_orange_circle: *Attention dotters:* SDK libs (Angular, Client, Experiments and React) published!
379397
>
380398
> This automated script is happy to announce that a new *_SDK libs_* version *tagged as:* [ `${{ steps.sdks_publish.outputs.npm-package-version }}` ] is now available on the `NPM` registry :package:!
381-
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
399+
> *Introduced by:* <${{ steps.pr_info.outputs.pr_url }}|${{ steps.pr_info.outputs.pr_ref }}>
400+
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/cicd_manual-release-sdks.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,20 @@ jobs:
120120
publish-latest: 'true'
121121
github-token: ${{ secrets.GITHUB_TOKEN }}
122122

123+
- name: 'Slack Notification (SDK release announcement)'
124+
if: success() && steps.deploy-javascript-sdk.outputs.published == 'true'
125+
continue-on-error: true
126+
uses: ./.github/actions/core-cicd/notification/notify-slack
127+
with:
128+
channel-id: "log-sdk-libs"
129+
payload: |
130+
> :large_green_circle: *Attention dotters:* SDK libs (Angular, Client, Experiments and React) officially released!
131+
>
132+
> This automated script is happy to announce that a new *_SDK libs_* version *tagged as:* [ `${{ steps.deploy-javascript-sdk.outputs.npm-package-version }}` ] is now available on the `NPM` registry :package:!
133+
> *Release type:* `${{ inputs.version-type }}` | *Triggered by:* `${{ github.actor }}`
134+
> <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run>
135+
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
136+
123137
- name: 'Open post-release PR to bump VERSION on main'
124138
env:
125139
RELEASE_VERSION: ${{ steps.compute_version.outputs.release_version }}

0 commit comments

Comments
 (0)