Skip to content

match whole package name, not substrings #178

match whole package name, not substrings

match whole package name, not substrings #178

Workflow file for this run

# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: semver-compare-check-dist
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
check-dist:
runs-on: ubuntu-latest
strategy:
matrix:
app:
- directory: ./semver-compare
- directory: ./go/go-test-results-parsing
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Node.js 20.x
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.x
- name: Rebuild the dist/ directory
run: |
cd ${{ matrix.app.directory }}
npm ci
npm run build
npm run package
- name: Compare the expected and actual dist/ directories
run: |
cd ${{ matrix.app.directory }}
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: failure()
with:
name: dist
path: ${{ matrix.app.directory }}/dist/