Skip to content

Commit

Permalink
Try with another repo
Browse files Browse the repository at this point in the history
  • Loading branch information
bayandin committed Sep 5, 2023
1 parent 30ec029 commit 2bf4a61
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/release-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,37 @@ jobs:
// Slack Message layout is created with https://app.slack.com/block-kit-builder
const urlForPr = function (prNumber) {
// TODO: revert back
// return `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/pull/${prNumber}`
return `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/pull/${prNumber}`
}
const linkify = function (text) {
return text.replace(/#(\d+)/g, (match, prNumber) => { return `<${urlForPr(prNumber)}|#${prNumber}>` })
}
# PRs for tests
# https://github.com/neondatabase/neon/pull/5202
# https://github.com/neondatabase/cloud/pull/6724
const { data: pullRequest } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
// repo: context.repo.repo,
repo: "cloud",
// pull_number: context.payload.number,
// TODO: revert back
pull_number: 5202
pull_number: 6724
});
const header = `"${pullRequest.title}" is coming :tada:`
const { data: commits } = await github.rest.pulls.listCommits({
owner: context.repo.owner,
repo: context.repo.repo,
// repo: context.repo.repo,
repo: "cloud",
// pull_number: context.payload.number,
// TODO: revert back
pull_number: 5202
pull_number: 6724
});
const blocks = []
Expand All @@ -95,7 +103,7 @@ jobs:
type: "mrkdwn",
// text: `Release PR: ${urlForPr(context.payload.number)`,
// TODO: revert back
text: `Release PR: <${urlForPr(5202)}|${urlForPr(5202)}>`,
text: `Release PR: <${urlForPr(6724)}|${urlForPr(6724)}>`,
},
],
})
Expand All @@ -122,6 +130,7 @@ jobs:
type: "context",
elements: [{
type: "mrkdwn",
// TODO: use PR updated time
text: `${{ steps.status-emoji.outputs.emoji }} Updated at <!date^${Math.floor(Date.now() / 1000)}^{date_num} {time_secs} (local time)|${new Date().toISOString()}>`,
}],
})
Expand All @@ -131,9 +140,6 @@ jobs:
blocks,
}
// TODO: Remove debug logging
console.log(JSON.stringify(slackMessage, null, 2))
return JSON.stringify(slackMessage)
- uses: actions/cache/restore@v3
Expand Down

0 comments on commit 2bf4a61

Please sign in to comment.