Skip to content

Commit

Permalink
[meta] update release workflow to prune footnotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 3, 2024
1 parent 5b20fe5 commit 6150d40
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,26 @@ jobs:
id: changelog
run: |
# Parse the changelog for common links
_links="$(grep -P '^\[.*]:.+' ${GITHUB_WORKSPACE}/CHANGELOG.md | sort -u)"
_links="$(egrep '^\[.*]:.+' ${GITHUB_WORKSPACE:-.}/CHANGELOG.md | sort -u)"
_links="${_links//'%'/'%25'}"
_links="${_links//$'\n'/'%0A'}"
# _links="${_links//$'\n'/'%0A'}"
_links="${_links//$'\r'/'%0D'}"
# Set output 'links' to $_links
DELIMITER=$(uuidgen)
echo "links<<${DELIMITER}" >> "${GITHUB_OUTPUT}"
echo "$_links" >> "${GITHUB_OUTPUT}"
echo "${DELIMITER}" >> "${GITHUB_OUTPUT}"
- uses: softprops/action-gh-release@v1
- id: prune-footnotes
run: |
tmp.md < "${{ steps.changelog_reader.outputs.changes }}"
tmp.md << ${{ steps.changelog.outputs.links }}
DELIMITER=$(uuidgen)
echo "body<<${DELIMITER}" >> "${GITHUB_OUTPUT}"
npx gfm-footnotes -i tmp.md > "${GITHUB_OUTPUT}"
echo "${DELIMITER}" >> "${GITHUB_OUTPUT}"
- uses: softprops/action-gh-release@v2
with:
body: |
${{ steps.changelog_reader.outputs.changes }}
${{ steps.changelog.outputs.links }}
${{ steps.prune-footnotes.outputs.body }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"eslint-remote-tester-repositories": "^1.0.1",
"eslint-scope": "^3.7.3",
"espree": "^3.5.4",
"gfm-footnotes": "^1.0.0",
"glob": "=10.3.7",
"istanbul": "^0.4.5",
"jackspeak": "=2.1.1",
Expand Down

0 comments on commit 6150d40

Please sign in to comment.