diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml index 0d97464e..998d1ad9 100644 --- a/.github/workflows/l10n.yml +++ b/.github/workflows/l10n.yml @@ -2,8 +2,8 @@ name: L10n on: workflow_dispatch: concurrency: - group: l10n - cancel-in-progress: true + group: codegen + cancel-in-progress: false permissions: contents: write pull-requests: write @@ -36,14 +36,19 @@ jobs: - name: Install xgotext run: | go install github.com/leonelquinteros/gotext/cli/xgotext@latest - - name: Generate pot files + - name: Generate pot files and commit run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" ~/go/bin/xgotext -default backend -pkg-tree ./cmd/ace -out ./pkg/embed/locales - cd web && pnpm run gettext:extract - - uses: stefanzweifel/git-auto-commit-action@v7 - name: Commit changes - with: - commit_message: "chore(l10n): update pot files" + (cd web && pnpm run gettext:extract) + if [ -z "$(git status --porcelain)" ]; then + echo "pot 文件无变更,跳过提交" + exit 0 + fi + git add -A + git commit -m "chore(l10n): update pot files" + git push origin HEAD:main - name: Sync with Crowdin uses: crowdin/github-action@v2 with: diff --git a/.github/workflows/mockery.yml b/.github/workflows/mockery.yml index d6a304c7..6a596807 100644 --- a/.github/workflows/mockery.yml +++ b/.github/workflows/mockery.yml @@ -3,6 +3,9 @@ on: push: branches: - main +concurrency: + group: codegen + cancel-in-progress: false permissions: contents: write jobs: @@ -19,11 +22,15 @@ jobs: - name: Install Mockery run: | go install github.com/vektra/mockery/v2@latest - - name: Generate Mocks + - name: Generate mocks and commit run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" ~/go/bin/mockery - git pull - - uses: stefanzweifel/git-auto-commit-action@v7 - name: Commit changes - with: - commit_message: "chore: update mocks" + if [ -z "$(git status --porcelain)" ]; then + echo "mock 无变更,跳过提交" + exit 0 + fi + git add -A + git commit -m "chore: update mocks" + git push origin HEAD:main