fix: auto-update dist folder in Renovate PRs via GitHub Actions

Replaces non-functional postUpgradeTasks configuration with a GitHub Actions
workflow that automatically rebuilds the distribution when Renovate opens PRs.

The previous approach used postUpgradeTasks and allowedCommands, which only
work with self-hosted Renovate. Since this repo uses GitHub's hosted Renovate
app, those settings were ignored, causing the dist folder to not be updated.

The new workflow:
- Triggers on PRs that modify package.json, package-lock.json, or src/
- Only runs for Renovate bot PRs
- Runs npm run all to rebuild dist/
- Commits and pushes changes back to the PR branch

This fixes the artifact update warnings in Renovate PRs like #294.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
jdx 2025-10-31 09:25:09 -05:00
parent 3a0b1ebdc6
commit 631581469e
No known key found for this signature in database
GPG key ID: 584DADE86724B407
2 changed files with 53 additions and 20 deletions

View file

@ -0,0 +1,52 @@
name: Update Distribution on Renovate PRs
on:
pull_request:
paths:
- 'package.json'
- 'package-lock.json'
- 'src/**'
- 'tsconfig.json'
permissions:
contents: write
pull-requests: write
jobs:
update-dist:
# Only run for Renovate PRs
if: github.actor == 'renovate[bot]' || github.actor == 'renovate-bot'
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build and package
run: npm run all
- name: Check for changes
id: git-check
run: |
git diff --exit-code dist/ || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.git-check.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add dist/
git commit -m "chore: rebuild distribution"
git push