Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Write file for changelog instead (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
JForsaken authored Apr 1, 2022
1 parent c436e87 commit 9b13e86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ jobs:
if: steps.release.outputs.released == 'true'
id: persist_release
env:
RAW_CHANGELOG: ${{ steps.fetch_release.outputs.body }}
REPO_URL: 'https://github.com/${{ github.repository }}'
run: |
mkdir tmp
touch tmp/changelog.txt
echo "${{ steps.fetch_release.outputs.body }}" > tmp/changelog.txt
cat tmp/changelog.txt
echo "::set-output name=released::${{ steps.release.outputs.released }}"
echo "::set-output name=changelog::$(node ./scripts/rewrite-changelog.js RAW_CHANGELOG $REPO_URL)"
echo "::set-output name=changelog::$(node ./scripts/rewrite-changelog.js ./tmp/changelog.txt $REPO_URL)"
bump_zapper_studio:
name: Bump on Zapper API
Expand Down
5 changes: 3 additions & 2 deletions scripts/rewrite-changelog.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const [envVarTarget, repoUrl] = process.argv.slice(2);
const fs = require('fs');
const [changelogFile, repoUrl] = process.argv.slice(2);

function run() {
const rawChangelog = process.env[envVarTarget];
const rawChangelog = fs.readFileSync(changelogFile).toString();
const prSectionExpr = /.*(\(#(\d.*)\))$/;

const lines = rawChangelog.split('\n');
Expand Down

0 comments on commit 9b13e86

Please sign in to comment.