Skip to content

feat: resolve Vite+ executable paths from VpDirs #31

feat: resolve Vite+ executable paths from VpDirs

feat: resolve Vite+ executable paths from VpDirs #31

Workflow file for this run

name: Rebuild action bundle
# The `needs-bundle-rebuild` label (Renovate adds it for bumps to deps compiled
# into dist/index.mjs, or to the vite-plus bundler) triggers a rebuild of the
# bundle and a push of the refreshed dist/, so the "Verify dist is up to date"
# check passes without a manual `vp run build`. `synchronize` re-runs the
# rebuild when Renovate rebases or pushes to a labeled PR, so a failed or stale
# rebuild gets retried; the run triggered by our own dist/ push finds no diff
# and exits without pushing, so it cannot loop.
on:
pull_request:
types: [labeled, synchronize]
permissions: {}
concurrency:
group: rebuild-bundle-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
rebuild:
name: rebuild bundle
# Only for labeled PRs (on the `labeled` event the just-added label is
# already in the array), and only same-repo branches we can push back to
# (Renovate PRs are same-repo; fork PRs can't be pushed to).
if: >-
contains(github.event.pull_request.labels.*.name, 'needs-bundle-rebuild') &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# A GitHub App token so the follow-up push re-triggers the PR's required
# checks; a push with the default GITHUB_TOKEN does not (loop prevention).
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
client-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
# Actions are pinned to a full commit SHA (org policy).
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ steps.app-token.outputs.token }}
# pnpm version is read from package.json's packageManager field.
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Rebuild the action bundle
run: pnpm build
- name: Commit and push the rebuilt bundle if it changed
run: |
if git diff --quiet -- dist/; then
echo "Bundle already up to date; nothing to push."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add dist/
git commit -m "chore: rebuild action bundle for dependency update"
git push