1
0
Fork 0
mirror of https://github.com/imjasonh/govulncheck-action synced 2026-07-18 06:35:32 +00:00

ci: auto-rebuild dist/ in dependabot PRs

Updates the dependabot-auto-merge workflow to rebuild and commit the dist/ directory. This fixes CI failures caused by dist/ being out of sync with package.json updates.

Signed-off-by: Jason Hall <imjasonh@gmail.com>
This commit is contained in:
Jason Hall 2026-02-21 02:07:47 -05:00
parent b71f124603
commit 29116efc49
2 changed files with 39 additions and 13 deletions

View file

@ -2,28 +2,28 @@ name: CI
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
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
@ -31,23 +31,23 @@ jobs:
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
fi

View file

@ -9,10 +9,36 @@ permissions:
jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Rebuild dist
run: npm run build
- name: Commit and push changes
run: |
if [ -n "$(git status --porcelain dist/)" ]; then
git config --global user.name "dependabot[bot]"
git config --global user.email "49699333+dependabot[bot]@users.noreply.github.com"
git add dist/
git commit -m "chore: rebuild dist"
git push
fi
- name: Enable auto-merge for Dependabot PRs
if: github.actor == 'dependabot[bot]'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}