diff --git a/.github/workflows/close-inactive.yml b/.github/workflows/close-inactive.yml index 78ea2a12..fb9280d6 100644 --- a/.github/workflows/close-inactive.yml +++ b/.github/workflows/close-inactive.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Find and optionally close inactive issues/PRs - uses: actions/github-script@v7 + uses: actions/github-script@v8 env: INACTIVE_DAYS: ${{ github.event_name == 'workflow_dispatch' && inputs.inactive_days || env.DEFAULT_INACTIVE_DAYS }} DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || env.DEFAULT_DRY_RUN }} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 77a09161..10ce0e3c 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -8,9 +8,32 @@ on: jobs: pre-commit: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 with: python-version: "3.12" - - uses: pre-commit/action@v3.0.1 + + - name: Install pre-commit + run: | + python -m pip install --upgrade pip + pip install pre-commit + + - name: Run pre-commit checks + run: | + pre-commit run --all-files + + # Optional: auto-fix and commit changes back to the branch + - name: Auto-fix and push + if: github.event_name == 'push' + run: | + pre-commit run --all-files --show-diff-on-failure + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Apply pre-commit fixes" || echo "No changes to commit" + git push