From c7d1422a9ff9b7c620428dd6699ebf483f124493 Mon Sep 17 00:00:00 2001 From: Gautam Botrel Date: Fri, 13 Sep 2024 15:43:05 -0500 Subject: [PATCH] build: ci test --- .github/workflows/slack-notifications.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/slack-notifications.yml b/.github/workflows/slack-notifications.yml index 7dc5dbd23..ed8ec1833 100644 --- a/.github/workflows/slack-notifications.yml +++ b/.github/workflows/slack-notifications.yml @@ -40,20 +40,12 @@ jobs: notify_slack: runs-on: ubuntu-latest steps: - - name: Set Slack message payload - id: set_payload + - name: Post to Slack run: | if [ "${{ inputs.status }}" == "success" ]; then - echo "::set-output name=payload::{\"text\":\"GitHub Action build result: success\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":white_check_mark: *Workflow Succeeded*\"}},{\"type\":\"section\",\"fields\":[{\"type\":\"mrkdwn\",\"text\":\"*Actor:*\n${{ inputs.actor }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Repository:*\n${{ inputs.repository }}\"},{\"type\":\"mrkdwn\",\"text\":\"*PR Title:*\n${{ inputs.pr_title }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Branch:*\n${{ inputs.branch }}\"}]},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*View Run:* \"}}]}" + payload="{\"text\":\"GitHub Action build result: success\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":white_check_mark: *Workflow Succeeded*\"}},{\"type\":\"section\",\"fields\":[{\"type\":\"mrkdwn\",\"text\":\"*Actor:*\n${{ inputs.actor }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Repository:*\n${{ inputs.repository }}\"},{\"type\":\"mrkdwn\",\"text\":\"*PR Title:*\n${{ inputs.pr_title }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Branch:*\n${{ inputs.branch }}\"}]},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*View Run:* \"}}]}" else - echo "::set-output name=payload::{\"text\":\"GitHub Action build result: failure\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":x: *Workflow Failed*\"}},{\"type\":\"section\",\"fields\":[{\"type\":\"mrkdwn\",\"text\":\"*Actor:*\n${{ inputs.actor }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Repository:*\n${{ inputs.repository }}\"},{\"type\":\"mrkdwn\",\"text\":\"*PR Title:*\n${{ inputs.pr_title }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Branch:*\n${{ inputs.branch }}\"}]},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Failed Step:* \"}},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Test Failure Details:* \n${{ inputs.failures }}\"}}]}" + payload="{\"text\":\"GitHub Action build result: failure\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":x: *Workflow Failed*\"}},{\"type\":\"section\",\"fields\":[{\"type\":\"mrkdwn\",\"text\":\"*Actor:*\n${{ inputs.actor }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Repository:*\n${{ inputs.repository }}\"},{\"type\":\"mrkdwn\",\"text\":\"*PR Title:*\n${{ inputs.pr_title }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Branch:*\n${{ inputs.branch }}\"}]},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Failed Step:* \"}},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Test Failure Details:* \n${{ inputs.failures }}\"}}]}" fi - shell: bash - - - name: Post to Slack - uses: slackapi/slack-github-action@v1.27.0 - with: - channel-id: 'team-gnark-build' - payload: ${{ steps.set_payload.outputs.payload }} - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + curl -X POST -H 'Content-type: application/json; charset=utf-8' --data "$payload" https://slack.com/api/chat.postMessage -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" + shell: bash \ No newline at end of file