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 1f1e3fd commit f8cc5fa
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,32 @@ jobs:
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"text": "🎉 New releases available:",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "🎉 New releases available:"
}
},
{{#each (fromJSON(steps.package_info.outputs.changes)) as |package|}}
{
"type": "section",
"fields": [
${run:
const changes = JSON.parse(steps.package_info.outputs.changes);
const blocks = [];
blocks.push({
type: "section",
text: {
type: "mrkdwn",
text: `🎉 New release of ${steps.package_info.outputs.name} (${steps.package_info.outputs.version}) is available!`
}
});
changes.forEach(package => {
blocks.push({
type: "section",
fields: [
{
"type": "mrkdwn",
"text": "*Package Name:*\n${{ package.name }}"
type: "mrkdwn",
text: `*Package Name:*\n${package.name}`
},
{
"type": "mrkdwn",
"text": "*Version:*\n${{ package.version }}"
type: "mrkdwn",
text: `*Version:*\n${package.version}`
}
]
},
{{/each}}
]
});
});
return { blocks };
}
env:
SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/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"

0 comments on commit f8cc5fa

Please sign in to comment.