mirror of
https://github.com/imjasonh/govulncheck-action
synced 2026-07-10 09:33:07 +00:00
Currently, the dependabot-auto-merge workflow (which rebuilds dist/) only runs if the actor is dependabot[bot]. If a human rebases a dependabot PR (e.g. via UI or CLI), this workflow is skipped, causing CI to fail because dist/ is out of sync. This change: 1. Relaxes the condition to run on any branch starting with 'dependabot/', regardless of actor. 2. Adds workflow_dispatch trigger for manual fixes. 3. Updates CI workflow permissions. Signed-off-by: Jason Hall <imjasonh@gmail.com>
58 lines
1.1 KiB
YAML
58 lines
1.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
actions: write
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
- name: Check test coverage
|
|
run: npm run test:coverage
|
|
|
|
dist-check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build dist
|
|
run: npm run build
|
|
|
|
- name: Check if dist is up to date
|
|
run: |
|
|
if [ -n "$(git status --porcelain dist/)" ]; then
|
|
echo "::error::dist/ is not up to date. Please run 'npm run build' and commit the changes."
|
|
git diff dist/
|
|
exit 1
|
|
fi
|