Skip to content

Commit

Permalink
Update existing message
Browse files Browse the repository at this point in the history
  • Loading branch information
bayandin committed Sep 5, 2023
1 parent 4112305 commit a8bdde5
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion .github/workflows/release-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
elements: [
{
type: "mrkdwn",
// text: `Release PR: <${urlForPr(context.payload.number)}|${urlForPr(context.payload.number)}>`,
// text: `Release PR: ${urlForPr(context.payload.number)`,
// TODO: revert back
text: `Release PR: <${urlForPr(5202)}|${urlForPr(5202)}>`,
},
Expand All @@ -77,11 +77,21 @@ jobs:
}
blocks.push({
"type": "divider"
}, {
type: "section",
text: {
type: "mrkdwn",
text: messageBody,
},
}, {
"type": "divider"
}, {
type: "context",
elements: [{
type: "plain_text",
text: `Updated at <!date^${Date.now() / 1000}^{date_num} {time_secs}|${new Date().toISOString()}>`,
}],
})
const slackMessage = {
Expand All @@ -94,9 +104,34 @@ jobs:
return JSON.stringify(slackMessage)
- uses: actions/cache/restore@v3
with:
path: release-notify.json
key: release-notify-${{ github.event.number }}.json

- id: message-id
run: |
if [ -f release-notify.json ]; then
UPDATE_TS=$(cat release-notify.json | jq --raw-output '.ts')
else
UPDATE_TS=""
fi
echo "update-ts=${UPDATE_TS}" >> $GITHUB_OUTPUT
- uses: slackapi/slack-github-action@v1
id: slack
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel-id: "C05QQ9J1BRC" # #test-release-notifications
update-ts: ${{ steps.message-id.outputs.update-ts }}
payload: ${{ steps.commitlist.outputs.result }}

- run: |
echo '{"ts": "${{ steps.slack.outputs.ts }}"}' > release-notify.json
- uses: actions/cache/save@v3
with:
path: release-notify.json
key: release-notify-${{ github.event.number }}.json

0 comments on commit a8bdde5

Please sign in to comment.