Skip to content

Commit

Permalink
build: ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Sep 13, 2024
1 parent 3e05da0 commit 6c46d32
Showing 1 changed file with 2 additions and 94 deletions.
96 changes: 2 additions & 94 deletions .github/workflows/slack-notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,103 +41,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Post to Slack
with:
payload-success: |
{
"channel": "team-gnark-build",
"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:* <https://github.com/${{ inputs.repository }}/actions/runs/${{ inputs.run_id }}|View Details>"
}
}
]
}
payload-failure: |
{
"channel": "team-gnark-build",
"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:* <https://github.com/${{ inputs.repository }}/actions/runs/${{ inputs.run_id }}|View Details>"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Test Failure Details:* \n${{ inputs.failures }}"
}
}
]
}
run: |
if [ "${{ inputs.status }}" == "success" ]; then
payload=$payload-success
payload="{\"channel\":\"team-gnark-build\",\"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:* <https://github.com/${{ inputs.repository }}/actions/runs/${{ inputs.run_id }}|View Details>\"}}]}"
else
payload=$payload-failure
payload="{\"channel\":\"team-gnark-build\",\"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:* <https://github.com/${{ inputs.repository }}/actions/runs/${{ inputs.run_id }}|View Details>\"}},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Test Failure Details:* \n${{ inputs.failures }}\"}}]}"
fi
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

0 comments on commit 6c46d32

Please sign in to comment.