Skip to content

Commit 1ccc430

Browse files
chore: updated slack webhook url config for more flexibility
1 parent 89a1341 commit 1ccc430

5 files changed

Lines changed: 15 additions & 10 deletions

File tree

.github/actions/notify-slack-publish-status/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ inputs:
66
description: 'Message to send to Slack'
77
required: true
88
default: ''
9+
webhook-url:
10+
description: 'Slack incoming webhook URL'
11+
required: true
912
runs:
1013
using: 'node20'
1114
main: 'index.js'

.github/actions/notify-slack-publish-status/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const core = require('@actions/core');
2-
const webhook = process.env.SDK_PUBLISH_SLACK_WEBHOOK;
2+
const webhook = core.getInput('webhook-url');
33

44
const run = async () => {
55
if (webhook) {

.github/workflows/publish-docs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ jobs:
127127
uses: ./.github/actions/notify-slack-publish-status
128128
with:
129129
message: "✅ SDK reference documents published successfully - https://docs.immutable.com/sdk-references/ts-immutable-sdk/${{ env.VERSION }}/\n\n>*`${{ env.GITHUB_USER }}` Please ensure you and the team updated all Sample Code + Guides on the <https://docs.immutable.com|imx-docs site> to reflect the change.*"
130-
130+
webhook-url: ${{ secrets.SDK_PUBLISH_SLACK_WEBHOOK }}
131+
131132
- name: Notify SDK Slack Docs Publish Failure
132133
if: ${{ failure() && steps.docs_version_check.conclusion == 'success' }}
133134
uses: ./.github/actions/notify-slack-publish-status
134135
with:
135136
message: "❌ Failed to publish SDK reference documents. Please check the logs for more details."
137+
webhook-url: ${{ secrets.SDK_PUBLISH_SLACK_WEBHOOK }}

.github/workflows/publish-example-tutorials.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,9 @@ jobs:
8989
GITHUB_TOKEN: ${{ secrets.TS_IMMUTABLE_SDK_GITHUB_TOKEN }}
9090
shell: bash
9191

92-
# - name: Notify Slack of New Docs PR
93-
# if: steps.create_pr.outputs.pr_url != ''
94-
# uses: slackapi/slack-github-action@v1.26.0
95-
# with:
96-
# channel-id: ${{ secrets.DOCS_PR_SLACK_CHANNEL_ID }}
97-
# slack-message: "New automated tutorials PR is ready for review: <${{ steps.create_pr.outputs.pr_url }}|View Pull Request>"
98-
# env:
99-
# SLACK_BOT_TOKEN: ${{ secrets.DOCS_PR_SLACK_BOT_TOKEN }}
92+
- name: Notify Slack
93+
if: steps.create_pr.outputs.pr_url != ''
94+
uses: ./.github/actions/notify-slack-publish-status
95+
with:
96+
message: 'New automated tutorials PR is ready for review: ${{ steps.create_pr.outputs.pr_url }}'
97+
webhook-url: ${{ secrets.SDK_DOCS_TUTORIALS_SLACK_WEBHOOK }}

.github/workflows/publish.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,14 @@ jobs:
156156
uses: ./.github/actions/notify-slack-publish-status
157157
with:
158158
message: "✅ ${{ github.triggering_actor }} successfully published SDK packages @ version ${{steps.release.outputs.RELEASE_NAME}} to NPM.\n\nhttps://www.npmjs.com/package/@imtbl/sdk/v/${{steps.release.outputs.RELEASE_NAME}}"
159+
webhook-url: ${{ secrets.SDK_PUBLISH_SLACK_WEBHOOK }}
159160

160161
- name: Notify SDK Slack Publish Failure
161162
if: ${{ failure() && (steps.npm_release.conclusion == 'failure') && env.DRY_RUN == 'false' }}
162163
uses: ./.github/actions/notify-slack-publish-status
163164
with:
164165
message: "❌ Failed to publish SDK version ${{steps.release.outputs.RELEASE_NAME}} to NPM. ${{ github.triggering_actor }} please check the logs for more details."
166+
webhook-url: ${{ secrets.SDK_PUBLISH_SLACK_WEBHOOK }}
165167

166168
- name: Wait for NPM @latest Update
167169
id: wait_for_npm_update

0 commit comments

Comments
 (0)