diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8aa7079..69fc02e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,7 +34,14 @@ jobs: run: echo "::set-output name=version::${GITHUB_REF#refs/*/}" id: release-version - name: Create release notes for version ${{ steps.release-version.outputs.version }} - run: npm run --silent changelog > RELEASE_NOTES_${{ steps.release-version.outputs.version }}.md + # run: npm run --silent changelog > RELEASE_NOTES_${{ steps.release-version.outputs.version }}.md + run: | + if [ $((grep $(grep -m1 'version' package.json | cut -d '"' -f 4) -n CHANGELOG.md || echo 0) | cut -d ':' -f 1) -eq 3 ]; then \ + awk '/##/{++c;next} c==1' CHANGELOG.md | awk '!/^$/'; \ + else \ + >&2 echo 'Unchecked version'; \ + echo 1; \ + fi > RELEASE_NOTES_${{ steps.release-version.outputs.version }}.md # https://github.com/ncipollo/release-action - name: Create github release uses: ncipollo/release-action@v1