mirror of
https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2025-10-03 16:20:58 +08:00
Update pr-auto-fix.yml
This commit is contained in:
parent
3e668d5a03
commit
67b99da2b4
1 changed files with 2 additions and 38 deletions
40
.github/workflows/pr-auto-fix.yml
vendored
40
.github/workflows/pr-auto-fix.yml
vendored
|
@ -1,3 +1,4 @@
|
|||
|
||||
name: PR Lint and Auto-Fix
|
||||
|
||||
on:
|
||||
|
@ -93,41 +94,4 @@ jobs:
|
|||
title: "Lint auto-fixes for ${github.head_ref}"
|
||||
commit-message: "chore: lint auto-fixes"
|
||||
body: "Auto-fixes for PR #${{ github.event.pull_request.number }}. Original branch is protected; merging this will apply the fixes."
|
||||
base: ${{ github.head_ref }} run: |
|
||||
if [ -f vendor/bin/php-cs-fixer ]; then
|
||||
chmod +x vendor/bin/php-cs-fixer
|
||||
vendor/bin/php-cs-fixer fix --allow-risky=yes || true
|
||||
else
|
||||
echo "PHP-CS-Fixer not found in vendor/, skipping."
|
||||
fi
|
||||
|
||||
# ESLint Fix
|
||||
- name: ESLint Fix
|
||||
run: |
|
||||
if [ -d node_modules ] && command -v npx > /dev/null; then
|
||||
npx eslint "update-api/**/*.js" --fix || true
|
||||
else
|
||||
echo "node_modules or npx not found, skipping ESLint."
|
||||
fi
|
||||
|
||||
# Stylelint Fix
|
||||
- name: Stylelint Fix
|
||||
run: |
|
||||
if [ -d node_modules ] && command -v npx > /dev/null; then
|
||||
npx stylelint "update-api/**/*.css" --fix || true
|
||||
else
|
||||
echo "node_modules or npx not found, skipping Stylelint."
|
||||
fi
|
||||
|
||||
# Commit changes directly to the PR branch
|
||||
- name: Commit fixes to PR branch
|
||||
run: |
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add .
|
||||
git commit -m "chore: auto-lint fixes"
|
||||
git push origin HEAD:${{ github.head_ref }}
|
||||
else
|
||||
echo "No changes to commit."
|
||||
fi
|
||||
base: ${{ github.head_ref }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue