Skip to content

Commit

Permalink
Add validate job that checks if dist needs to be rebuilt (#33)
Browse files Browse the repository at this point in the history
* Add validate job that checks if dist needs to be rebuilt

* Update dist
  • Loading branch information
flaeppe authored Aug 22, 2022
1 parent b1ce9b2 commit 745704f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,30 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12.x'
- run: npm ci
- run: npm run lint
- run: npm test

validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12.x'
- name: Validate build
shell: bash
run: |
set -e
npm ci
git add -A
npm run package
if [ -n "$(git status --porcelain -- dist)" ]; then
echo "::error::Build result differs. Run 'npm run package' then commit and push any changes"
git status --porcelain -- dist
exit 1
fi
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8443,7 +8443,7 @@ const TRANSFORMERS = {
.trim()
.replace(/\s+/g, "-")
.toLowerCase()
.replace(/[^a-z0-9_]/g, "")
.replace(/[^a-z0-9-_]/g, "")
.replace(/-+$/g, "");
return `#${number}-${name}`;
},
Expand Down

0 comments on commit 745704f

Please sign in to comment.