mirror of
https://github.com/jdx/mise-action.git
synced 2026-05-14 13:50:33 +00:00
feat: use autofix.ci to auto-update dist/ on all PRs
Switches from manual commit workflow to autofix.ci for automatically updating the dist/ folder when source files change. This has several advantages: 1. Works on ALL PRs, not just Renovate PRs 2. Commits made by autofix.ci (GitHub App) trigger CI workflows, unlike commits made with GITHUB_TOKEN which don't trigger workflows 3. Renovate recognizes autofix.ci commits via gitIgnoredAuthors and can still auto-rebase PRs Changes: - Renamed workflow from renovate-dist-update to auto-update-dist - Removed Renovate-only condition - now runs on all PRs - Replaced manual git commit/push with autofix.ci action - Updated renovate.json to ignore autofix.ci commits - Changed permissions from write to read-only Note: Requires installing the autofix.ci GitHub App: https://github.com/apps/autofix-ci 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
993e7d0bb6
commit
16e9fd5251
3 changed files with 36 additions and 53 deletions
2
.github/renovate.json
vendored
2
.github/renovate.json
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": ["github>jdx/renovate-config"],
|
"extends": ["github>jdx/renovate-config"],
|
||||||
"gitIgnoredAuthors": ["github-actions[bot]@users.noreply.github.com"],
|
"gitIgnoredAuthors": ["autofix.ci[bot] <autofix.ci[bot]@users.noreply.github.com>"],
|
||||||
"rebaseWhen": "conflicted"
|
"rebaseWhen": "conflicted"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
35
.github/workflows/auto-update-dist.yml
vendored
Normal file
35
.github/workflows/auto-update-dist.yml
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
name: Auto-update Distribution
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'package.json'
|
||||||
|
- 'package-lock.json'
|
||||||
|
- 'src/**'
|
||||||
|
- 'tsconfig.json'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-dist:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout PR branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '24'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build and package
|
||||||
|
run: npm run all
|
||||||
|
|
||||||
|
- name: autofix.ci
|
||||||
|
uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
|
||||||
52
.github/workflows/renovate-dist-update.yml
vendored
52
.github/workflows/renovate-dist-update.yml
vendored
|
|
@ -1,52 +0,0 @@
|
||||||
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: '24'
|
|
||||||
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
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue