Merge pull request #18 from nqminds/feat/compare-sboms #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and Check | |
on: | |
push: | |
paths: | |
- "src/**" | |
- "scripts/**" | |
- "server/**" | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "src/**" | |
- "scripts/**" | |
- "server/**" | |
jobs: | |
lint-and-check: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: "https://registry.npmjs.org" | |
cache: "npm" | |
- name: Install npm dependencies | |
run: npm ci --ignore-scripts | |
- name: Run lint | |
run: npm run lint | |
- name: Check for uncommitted/unignored files | |
shell: bash | |
run: | | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "No changes detected" | |
else | |
echo "error::Detected uncommitted files after running lint." | |
git status --verbose --verbose | |
exit 1 | |
fi |