Skip to content

Commit

Permalink
try with slack_on_fail_block_kit.json
Browse files Browse the repository at this point in the history
  • Loading branch information
moshe-azaria-sage committed Mar 18, 2024
1 parent fb87162 commit 78d8298
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/on-fail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,25 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Read Slack JSON file
id: read_json
run: |
JSON_CONTENT=$(jq '.' .github/resources/slack_on_fail_block_kit.json --compact-output)
# JSON_CONTENT=$(cat .github/resources/slack_on_fail_block_kit.json)
echo "json_content<<EOF" >> $GITHUB_OUTPUT
echo "$JSON_CONTENT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# echo "json_content=$JSON_CONTENT" >> $GITHUB_OUTPUT
# - name: Read Slack JSON file
# id: read_json
# run: |
# JSON_CONTENT=$(jq '.' .github/resources/slack_on_fail_block_kit.json --compact-output)
# # JSON_CONTENT=$(cat .github/resources/slack_on_fail_block_kit.json)
# echo "json_content<<EOF" >> $GITHUB_OUTPUT
# echo "$JSON_CONTENT" >> $GITHUB_OUTPUT
# echo "EOF" >> $GITHUB_OUTPUT
# # echo "json_content=$JSON_CONTENT" >> $GITHUB_OUTPUT

# - run: |
# echo "${{ steps.read_json.outputs.json_content }}"
- run: |
echo "${{ fromJson(steps.read_json.outputs.json_content) }}"
# - run: |
# echo "${{ fromJson(steps.read_json.outputs.json_content) }}"

- uses: slackapi/slack-github-action@v1.24.0
with:
payload: ${{ fromJson(steps.read_json.outputs.json_content) }}
# payload: ${{ fromJson(steps.read_json.outputs.json_content) }}
payload-file-path: .github/resources/slack_on_fail_block_kit.json
env:
SLACK_WEBHOOK_URL: ${{ secrets.MOSHE_PERSONAL_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

0 comments on commit 78d8298

Please sign in to comment.