Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasKn committed Mar 19, 2024
1 parent ce7976a commit 942d939
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions .github/workflows/slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,32 @@ jobs:
]
});
});
core.setOutput("blocks", JSON.stringify(blocks));
- name: Send custom JSON data to Slack workflow
id: slack
uses: slackapi/[email protected]
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"text": "πŸŽ‰ New release!",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "πŸŽ‰ New release!"
}
}
]
}
env:
SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/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"
const message = {
"text": "πŸŽ‰ New release!",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "πŸŽ‰ New release!"
}
},
...blocks
]
}
core.setOutput("blocks", JSON.stringify(message));
- name: Echo blocks
id: echo
run: |
echo ${{fromJson(steps.package_info.outputs.blocks)}}
# - name: Send custom JSON data to Slack workflow
# id: slack
# uses: slackapi/[email protected]
# with:
# # This data can be any valid JSON from a previous step in the GitHub Action
# payload: |
# ${{fromJson(steps.package_info.outputs.blocks)}}
# env:
# SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/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"

0 comments on commit 942d939

Please sign in to comment.