From a88d46bdb7f1c4de077c8785c2c4046671d1fef6 Mon Sep 17 00:00:00 2001 From: snomiao Date: Wed, 13 Aug 2025 05:21:29 +0000 Subject: [PATCH] use auto-commit-action to handle pullrequest-ref name --- .github/workflows/lint-and-format.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint-and-format.yaml b/.github/workflows/lint-and-format.yaml index 1605cace8..6acbb4dfa 100644 --- a/.github/workflows/lint-and-format.yaml +++ b/.github/workflows/lint-and-format.yaml @@ -44,14 +44,12 @@ jobs: echo "changed=false" >> $GITHUB_OUTPUT fi + # commit prettier fixed code - name: Commit changes if: steps.verify-changed-files.outputs.changed == 'true' && github.event.pull_request.head.repo.full_name == github.repository - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "[auto-fix] Apply ESLint and Prettier fixes" - git push + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: '[auto-fix] Apply ESLint and Prettier fixe' - name: Final validation run: | @@ -81,4 +79,4 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, body: '## ⚠️ Linting/Formatting Issues Found\n\nThis PR has linting or formatting issues that need to be fixed.\n\n**Since this PR is from a fork, auto-fix cannot be applied automatically.**\n\n### Option 1: Set up pre-commit hooks (recommended)\nRun this once to automatically format code on every commit:\n```bash\nnpm run prepare\n```\n\n### Option 2: Fix manually\nRun these commands and push the changes:\n```bash\nnpm run lint:fix\nnpm run format\n```\n\nSee [CONTRIBUTING.md](https://github.com/Comfy-Org/ComfyUI_frontend/blob/main/CONTRIBUTING.md#git-pre-commit-hooks) for more details.' - }) \ No newline at end of file + })