Migrate slack notifications to GChat
Issue gh-15503 [skip ci]
This commit is contained in:
parent
4ce7cde155
commit
7215c72373
|
@ -9,7 +9,6 @@ on:
|
||||||
workflow_dispatch: # Manual trigger
|
workflow_dispatch: # Manual trigger
|
||||||
|
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
||||||
GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
|
GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
|
||||||
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
|
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
|
||||||
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
|
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
|
||||||
|
@ -241,26 +240,11 @@ jobs:
|
||||||
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
||||||
echo "Tagging and publishing $REPO@$VERSION release on GitHub."
|
echo "Tagging and publishing $REPO@$VERSION release on GitHub."
|
||||||
./gradlew createGitHubRelease -PnextVersion=$VERSION -Pbranch=$BRANCH -PcreateRelease=true -PgitHubAccessToken=$TOKEN
|
./gradlew createGitHubRelease -PnextVersion=$VERSION -Pbranch=$BRANCH -PcreateRelease=true -PgitHubAccessToken=$TOKEN
|
||||||
- name: Announce Release on Slack
|
- name: Announce Release on GChat
|
||||||
id: spring-security-announcing
|
|
||||||
uses: slackapi/slack-github-action@v1.19.0
|
|
||||||
with:
|
|
||||||
payload: |
|
|
||||||
{
|
|
||||||
"text": "spring-security-announcing `${{ env.VERSION }}` is available now",
|
|
||||||
"blocks": [
|
|
||||||
{
|
|
||||||
"type": "section",
|
|
||||||
"text": {
|
|
||||||
"type": "mrkdwn",
|
|
||||||
"text": "spring-security-announcing `${{ env.VERSION }}` is available now"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }}
|
WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}
|
||||||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
run: |
|
||||||
|
curl -X POST '${{ env.WEBHOOK_URL }}' -H 'Content-Type: application/json' -d '{ "text": "spring-security-announcing `${{ env.VERSION }}` is available now" }' || true
|
||||||
- name: Setup git config
|
- name: Setup git config
|
||||||
run: |
|
run: |
|
||||||
git config user.name 'github-actions[bot]'
|
git config user.name 'github-actions[bot]'
|
||||||
|
@ -295,20 +279,13 @@ jobs:
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
- name: Schedule next release (if not already scheduled)
|
- name: Schedule next release (if not already scheduled)
|
||||||
run: ./gradlew scheduleNextRelease -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
|
run: ./gradlew scheduleNextRelease -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
|
||||||
notify_result:
|
send-notification:
|
||||||
name: Check for failures
|
name: Send Notification
|
||||||
needs: [perform_release, perform_post_release]
|
needs: [ perform_release, perform_post_release ]
|
||||||
if: failure()
|
if: ${{ failure() || cancelled() }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
steps:
|
steps:
|
||||||
- name: Send Slack message
|
- name: Send Notification
|
||||||
# Workaround while waiting for Gamesight/slack-workflow-status#38 to be fixed
|
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@v1
|
||||||
# See https://github.com/Gamesight/slack-workflow-status/issues/38
|
|
||||||
uses: sjohnr/slack-workflow-status@v1-beta
|
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}
|
||||||
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
||||||
channel: '#spring-security-ci'
|
|
||||||
name: 'CI Notifier'
|
|
||||||
|
|
Loading…
Reference in New Issue