Skip to content

Commit 7149622

Browse files
committed
Revert "Migrate slack notifications to GChat"
This reverts commits: - 5d335cc - a5b1dec
1 parent e9e0ec8 commit 7149622

File tree

3 files changed

+52
-29
lines changed

3 files changed

+52
-29
lines changed

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

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,26 @@ jobs:
209209
run: |
210210
echo "Tagging and publishing $REPO@$VERSION release on GitHub."
211211
./gradlew createGitHubRelease -PnextVersion=$VERSION -Pbranch=$BRANCH -PcreateRelease=true -PgitHubAccessToken=$TOKEN
212-
- name: Announce Release on GChat
212+
- name: Announce Release on Slack
213+
id: spring-security-announcing
214+
uses: slackapi/[email protected]
215+
with:
216+
payload: |
217+
{
218+
"text": "spring-security-announcing `${{ env.VERSION }}` is available now",
219+
"blocks": [
220+
{
221+
"type": "section",
222+
"text": {
223+
"type": "mrkdwn",
224+
"text": "spring-security-announcing `${{ env.VERSION }}` is available now"
225+
}
226+
}
227+
]
228+
}
213229
env:
214-
WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}
215-
run: |
216-
curl -X POST '$WEBHOOK_URL' -H 'Content-Type: application/json' -d '{ text: "spring-security-announcing `$VERSION` is available now" }' || true
230+
SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }}
231+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
217232
- name: Setup git config
218233
run: |
219234
git config user.name 'github-actions[bot]'
@@ -245,16 +260,20 @@ jobs:
245260
distribution: 'adopt'
246261
- name: Schedule next release (if not already scheduled)
247262
run: ./gradlew scheduleNextRelease -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
248-
send-notification:
249-
name: Send Notification
250-
needs: [ perform_release, perform_post_release ]
263+
notify_result:
264+
name: Check for failures
265+
needs: [perform_release, perform_post_release]
251266
if: failure()
252267
runs-on: ubuntu-latest
268+
permissions:
269+
actions: read
253270
steps:
254-
- name: Send Notification
255-
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@v1
271+
- name: Send Slack message
272+
# Workaround while waiting for Gamesight/slack-workflow-status#38 to be fixed
273+
# See https://github.com/Gamesight/slack-workflow-status/issues/38
274+
uses: sjohnr/slack-workflow-status@v1-beta
256275
with:
257-
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}
258-
status: ${{ job.status }}
259-
build-scan-url: ${{ steps.build-and-publish.outputs.build-scan-url }}
260-
run-name: ${{ format('spring-security/{0}', github.ref_name) }}
276+
repo_token: ${{ secrets.GITHUB_TOKEN }}
277+
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
278+
channel: '#spring-security-ci'
279+
name: 'CI Notifier'

.github/workflows/milestone-spring-releasetrain.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ env:
88
permissions:
99
contents: read
1010
jobs:
11-
spring-releasetrain-checks:
11+
spring-releasetrain-checks:
1212
name: Check DueOn is on a Release Date
1313
runs-on: ubuntu-latest
1414
if: ${{ github.repository == 'spring-projects/spring-security' }}
@@ -23,16 +23,18 @@ jobs:
2323
export TOOL_VERSION=0.1.1
2424
wget "https://repo.maven.apache.org/maven2/io/spring/releasetrain/spring-release-train-tools/$TOOL_VERSION/spring-release-train-tools-$TOOL_VERSION.jar"
2525
java -cp "spring-release-train-tools-$TOOL_VERSION.jar" io.spring.releasetrain.CheckMilestoneDueOnMain --dueOn "$DUE_ON" --expectedDayOfWeek MONDAY --expectedMondayCount 3
26-
send-notification:
27-
name: Send Notification
28-
needs: [ spring-releasetrain-checks ]
26+
notify_result:
27+
name: Check for failures
28+
needs: [spring-releasetrain-checks]
2929
if: failure()
3030
runs-on: ubuntu-latest
31+
permissions:
32+
actions: read
3133
steps:
32-
- name: Send Notification
33-
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@v1
34+
- name: Send Slack message
35+
uses: Gamesight/slack-workflow-status@v1.3.0
3436
with:
35-
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}
36-
status: ${{ job.status }}
37-
build-scan-url: ${{ steps.build-and-publish.outputs.build-scan-url }}
38-
run-name: ${{ format('spring-security/{0}', github.ref_name) }}
37+
repo_token: ${{ secrets.GITHUB_TOKEN }}
38+
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
39+
channel: '#spring-security-ci'
40+
name: 'CI Notifier'

.github/workflows/update-scheduled-release-version.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
workflow_dispatch: # Manual trigger only. Triggered by release-scheduler.yml on main.
55

66
env:
7+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
78
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
89

910
permissions:
@@ -57,11 +58,12 @@ jobs:
5758
git tag $updatedVersion
5859
git push
5960
git push origin $updatedVersion
60-
- name: Send Notification
61+
- id: send-slack-notification
62+
name: Send Slack message
6163
if: failure()
62-
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@v1
64+
uses: Gamesight/slack-workflow-status@v1.3.0
6365
with:
64-
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}
65-
status: ${{ job.status }}
66-
build-scan-url: ${{ steps.build-and-publish.outputs.build-scan-url }}
67-
run-name: ${{ format('spring-security/{0}', github.ref_name) }}
66+
repo_token: ${{ secrets.GITHUB_TOKEN }}
67+
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
68+
channel: '#spring-security-ci'
69+
name: 'CI Notifier'

0 commit comments

Comments
 (0)