Skip to content

Commit 330f19a

Browse files
author
Martí Malek
committed
ci: simplify generate release notes step
1 parent 5a7b32d commit 330f19a

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/library.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,25 @@ jobs:
4040
node-version: 18
4141
- name: Install dependencies
4242
uses: bahmutov/npm-install@v1
43-
- name: Preview release
44-
id: semantic-release
43+
- name: Generate release notes
44+
id: generate-release-notes
4545
run: |
4646
# locally get to the result of merging the current branch into the base branch (destination)
4747
git checkout -b ${{ github.base_ref }} ${{ github.event.after }}
48-
unset GITHUB_ACTIONS; npx semantic-release --no-ci --dry-run > output.txt
49-
OUTPUT=$(cat output.txt | base64 -w 0)
50-
echo "::set-output name=releaseNote::$OUTPUT"
51-
# echo "releaseNote=$OUTPUT" >> $GITHUB_OUTPUT
48+
unset GITHUB_ACTIONS
49+
RELEASE_NOTES=$(npx semantic-release --no-ci --dry-run | base64 -w 0)
50+
echo "releaseNotes=$RELEASE_NOTES" >> $GITHUB_OUTPUT
5251
env:
5352
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5453
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5554
- name: Report semantic release in PR
5655
uses: actions/github-script@v3
57-
if: ${{ steps.semantic-release.outputs.releaseNote != '' }}
56+
if: ${{ steps.generate-release-notes.outputs.releaseNotes != '' }}
5857
with:
5958
github-token: ${{ secrets.GITHUB_TOKEN }}
6059
script: |
6160
// build release note
62-
const semanticReleaseOutput = Buffer.from('${{ steps.semantic-release.outputs.releaseNote }}', 'base64').toString('utf8');
61+
const semanticReleaseOutput = Buffer.from('${{ steps.generate-release-notes.outputs.releaseNotes }}', 'base64').toString('utf8');
6362
const semanticReleaseLogMatch = /^[[0-9:\sAMPM]+\]\s\[semantic-release\].*$/;
6463
const lines = semanticReleaseOutput.split('\n');
6564
const lastSemanticReleaseLogIndex = [...lines]

0 commit comments

Comments
 (0)