-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix creating release message file (#1228)
- Loading branch information
Showing
3 changed files
with
33 additions
and
12 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 |
---|---|---|
|
@@ -16,7 +16,6 @@ jobs: | |
outputs: | ||
published: ${{ steps.changesets.outputs.published }} | ||
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }} | ||
releaseMessage: ${{ steps.changesets.outputs.releaseMessage }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
@@ -42,8 +41,6 @@ jobs: | |
npx changeset version | ||
npm i | ||
node scripts/post-changeset.js | ||
releaseMessage="$(cat output/release-message.txt)" | ||
echo "releaseMessage=$releaseMessage" >> "$GITHUB_OUTPUT" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
@@ -184,11 +181,26 @@ jobs: | |
name: Post the Release Message | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Write release message to file | ||
run: node scripts/write-release-message.js | ||
|
||
- name: Post to a Slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: C019K52TC0L #releases | ||
slack-message: ${{ needs.release.outputs.releaseMessage }} | ||
payload-file-path: './output/release-message.json' | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.RELEASES_SLACK_BOT_TOKEN }} |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const fs = require('fs'); | ||
const slackifyMarkdown = require('slackify-markdown'); | ||
|
||
const generatedLogsCli = fs.readFileSync('./packages/cli/CHANGELOG.md').toString(); | ||
const [, logCli] = generatedLogsCli.split('\n## ', 2); | ||
const generatedLogsCore = fs.readFileSync('./packages/core/CHANGELOG.md').toString(); | ||
const [, logCore] = generatedLogsCore.split('\n## ', 2); | ||
|
||
fs.mkdirSync('./output', { recursive: true }); | ||
fs.writeFileSync( | ||
'./output/release-message.json', | ||
JSON.stringify({ | ||
text: slackifyMarkdown( | ||
`:bookmark: New @redocly/cli release ${logCli}\n\n:bookmark: New @redocly/openapi-core release ${logCore}\n\n` | ||
), | ||
}) | ||
); |
747b6ee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report
Test suite run success
622 tests passing in 91 suites.
Report generated by 🧪jest coverage report action from 747b6ee