-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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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" |