diff --git a/action.yml b/action.yml index 6ec2da5..ef25d75 100644 --- a/action.yml +++ b/action.yml @@ -107,10 +107,26 @@ runs: arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository build-root-directory: ./sdk/java gradle-version: 7.4.1 - - if: failure() && github.event_name == 'push' - name: Notify Slack - uses: 8398a7/action-slack@v3 - with: - author_name: Failure in publishing SDK - fields: repo,commit,author,action - status: ${{ job.status }} + - name: Notify success + env: + SLACK_CHANNEL: provider-upgrade-status + SLACK_COLOR: "#00FF00" + SLACK_MESSAGE: |- + Publish succeeded :heart_decoration: + SLACK_TITLE: ${{ github.event.repository.name }} Publish result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ env.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ":taco:" + uses: rtCamp/action-slack-notify@v2 + - name: Notify failure + env: + SLACK_CHANNEL: provider-upgrade-status + SLACK_COLOR: "#FF0000" + SLACK_MESSAGE: |- + Publish failed :x: + SLACK_TITLE: ${{ github.event.repository.name }} upgrade result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ env.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ":taco:" + if: ${{ failure() }} + uses: rtCamp/action-slack-notify@v2