Skip to content

Commit 7215c72

Browse files
sjohnrrwinch
authored andcommitted
Migrate slack notifications to GChat
Issue gh-15503 [skip ci]
1 parent 4ce7cde commit 7215c72

File tree

1 file changed

+11
-34
lines changed

1 file changed

+11
-34
lines changed

.github/workflows/continuous-integration-workflow.yml

+11-34
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
workflow_dispatch: # Manual trigger
1010

1111
env:
12-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
1312
GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
1413
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
1514
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
@@ -241,26 +240,11 @@ jobs:
241240
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
242241
echo "Tagging and publishing $REPO@$VERSION release on GitHub."
243242
./gradlew createGitHubRelease -PnextVersion=$VERSION -Pbranch=$BRANCH -PcreateRelease=true -PgitHubAccessToken=$TOKEN
244-
- name: Announce Release on Slack
245-
id: spring-security-announcing
246-
uses: slackapi/[email protected]
247-
with:
248-
payload: |
249-
{
250-
"text": "spring-security-announcing `${{ env.VERSION }}` is available now",
251-
"blocks": [
252-
{
253-
"type": "section",
254-
"text": {
255-
"type": "mrkdwn",
256-
"text": "spring-security-announcing `${{ env.VERSION }}` is available now"
257-
}
258-
}
259-
]
260-
}
243+
- name: Announce Release on GChat
261244
env:
262-
SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }}
263-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
245+
WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}
246+
run: |
247+
curl -X POST '${{ env.WEBHOOK_URL }}' -H 'Content-Type: application/json' -d '{ "text": "spring-security-announcing `${{ env.VERSION }}` is available now" }' || true
264248
- name: Setup git config
265249
run: |
266250
git config user.name 'github-actions[bot]'
@@ -295,20 +279,13 @@ jobs:
295279
distribution: 'adopt'
296280
- name: Schedule next release (if not already scheduled)
297281
run: ./gradlew scheduleNextRelease -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
298-
notify_result:
299-
name: Check for failures
300-
needs: [perform_release, perform_post_release]
301-
if: failure()
282+
send-notification:
283+
name: Send Notification
284+
needs: [ perform_release, perform_post_release ]
285+
if: ${{ failure() || cancelled() }}
302286
runs-on: ubuntu-latest
303-
permissions:
304-
actions: read
305287
steps:
306-
- name: Send Slack message
307-
# Workaround while waiting for Gamesight/slack-workflow-status#38 to be fixed
308-
# See https://github.com/Gamesight/slack-workflow-status/issues/38
309-
uses: sjohnr/slack-workflow-status@v1-beta
288+
- name: Send Notification
289+
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@v1
310290
with:
311-
repo_token: ${{ secrets.GITHUB_TOKEN }}
312-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
313-
channel: '#spring-security-ci'
314-
name: 'CI Notifier'
291+
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}

0 commit comments

Comments
 (0)