Compare commits

...

7 Commits

Author SHA1 Message Date
snomiao
b4bf72b2b7 Merge branch 'main' into sno-lint-issue-write 2025-08-13 15:56:38 +09:00
snomiao
45b43aa093 feat: Add issues write permission to workflows to avoid lint and i18n workflow conflicts
- Add issues: write permission to lint-and-format.yaml
- Add issues: write permission to i18n.yaml
- Prevents workflow conflicts when updating PR statuses or comments
2025-08-13 06:50:54 +00:00
snomiao
ec2888a116 [auto-fix] Apply ESLint and Prettier fixe 2025-08-13 05:25:41 +00:00
snomiao
0f747f3c5d use auto-commit-action to handle pullrequest-ref name 2025-08-13 05:21:29 +00:00
snomiao
7ee33e2892 kick-format-modify-main-ts 2025-08-12 11:52:25 +00:00
snomiao
73f71fc018 kick-format 2025-08-12 11:48:32 +00:00
snomiao
6b085ea8c4 [feat] Add issues: write permission to lint-and-format workflow
The lint-and-format workflow creates comments on PRs, which requires
the issues: write permission to function properly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 06:49:15 +00:00
2 changed files with 8 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
name: Update Locales
on:
pull_request:
push:
branches: [ main, master, dev* ]
paths-ignore:
- '.github/**'
@@ -12,8 +12,6 @@ on:
jobs:
update-locales:
# Don't run on fork PRs
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v2.3
@@ -39,13 +37,7 @@ jobs:
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git fetch origin ${{ github.head_ref }}
# Stash any local changes before checkout
git stash -u
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
# Apply the stashed changes if any
git stash pop || true
git add src/locales/
git diff --staged --quiet || git commit -m "Update locales [skip ci]"
git push origin HEAD:${{ github.head_ref }}
git push origin HEAD
working-directory: ComfyUI_frontend

View File

@@ -7,6 +7,7 @@ on:
permissions:
contents: write
pull-requests: write
issues: write
jobs:
lint-and-format:
@@ -43,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 fix'
- name: Final validation
run: |
@@ -80,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.'
})
})