Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
1 line
6.7 KiB
JSON
1 line
6.7 KiB
JSON
{"repo": "aho1ic/dbx", "files": {".github/workflows/i18n-autofill.yml": {"417f620831bf051b45c86736c9096712d0950093": {"t": 1786068539.7357173, "n": 6269, "h": "73e536c69bc29dd7", "c": "name: I18n Autofill\n\non:\n pull_request_target:\n types: [opened, synchronize, reopened, ready_for_review]\n paths:\n - \"apps/desktop/src/i18n/locales/**\"\n - \".github/scripts/i18n-autofill.mjs\"\n - \".github/workflows/i18n-autofill.yml\"\n\npermissions:\n contents: write\n issues: write\n # 需要 write 才能通过 gh pr comment (addComment) 在 PR 上发评论;\n # 之前是 read,导致 autofill 成功 push 了翻译 commit 却无法发评论告知作者\n pull-requests: write\n\nconcurrency:\n group: i18n-autofill-${{ github.event.pull_request.number }}\n cancel-in-progress: true\n\njobs:\n autofill:\n if: github.event.pull_request.draft == false\n runs-on: ubuntu-22.04\n steps:\n - name: Checkout trusted base script\n uses: actions/checkout@v5\n with:\n ref: ${{ github.event.pull_request.base.sha }}\n\n - name: Copy trusted script\n run: cp .github/scripts/i18n-autofill.mjs \"$RUNNER_TEMP/i18n-autofill.mjs\"\n\n - name: Checkout pull request branch\n uses: actions/checkout@v5\n with:\n repository: ${{ github.event.pull_request.head.repo.full_name }}\n ref: ${{ github.event.pull_request.head.sha }}\n token: ${{ secrets.I18N_BOT_TOKEN || secrets.GITHUB_TOKEN }}\n fetch-depth: 0\n # The workflow executes the trusted base-branch script copied above;\n # fork contents are only parsed as translation data, never executed.\n allow-unsafe-pr-checkout: true\n\n - name: Fetch base branch\n env:\n BASE_REF: ${{ github.event.pull_request.base.ref }}\n run: |\n git remote add base \"https://github.com/${{ github.repository }}.git\"\n git fetch --no-tags --depth=1 base \"${BASE_REF}\"\n\n - name: Setup Node.js\n uses: actions/setup-node@v6\n with:\n node-version: 22.13.0\n\n - name: Autofill missing i18n entries\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n DEEPSEEK_MODEL: ${{ vars.DEEPSEEK_MODEL || 'deepseek-v4-pro' }}\n I18N_BASE_REF: base/${{ github.event.pull_request.base.ref }}\n I18N_SUMMARY_FILE: ${{ runner.temp }}/i18n-summary.json\n run: node \"$RUNNER_TEMP/i18n-autofill.mjs\" --write\n\n - name: Commit and push translation patch\n id: patch\n env:\n PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}\n run: |\n if git diff --quiet -- apps/desktop/src/i18n/locales; then\n echo \"No i18n autofill changes to commit\"\n echo \"changed=false\" >> \"$GITHUB_OUTPUT\"\n exit 0\n fi\n\n git config user.name \"dbx-i18n-bot\"\n git config user.email \"github-actions[bot]@users.noreply.github.com\"\n git add apps/desktop/src/i18n/locales\n git commit -m \"chore(i18n): autofill new translations\"\n if git push origin \"HEAD:${PR_HEAD_REF}\"; then\n echo \"push_failed=false\" >> \"$GITHUB_OUTPUT\"\n else\n echo \"push_failed=true\" >> \"$GITHUB_OUTPUT\"\n git diff HEAD~1 HEAD -- apps/desktop/src/i18n/locales > \"$RUNNER_TEMP/i18n-autofill.patch\"\n fi\n echo \"changed=true\" >> \"$GITHUB_OUTPUT\"\n\n - name: Comment autofill result\n if: steps.patch.outputs.changed == 'true' && steps.patch.outputs.push_failed != 'true'\n env:\n GH_TOKEN: ${{ secrets.I18N_BOT_TOKEN || secrets.GITHUB_TOKEN }}\n PR_NUMBER: ${{ github.event.pull_request.number }}\n SUMMARY_FILE: ${{ runner.temp }}/i18n-summary.json\n BODY_FILE: ${{ runner.temp }}/i18n-autofill-comment.md\n run: |\n node <<'NODE'\n const fs = require(\"node:fs\");\n\n const summary = JSON.parse(fs.readFileSync(process.env.SUMMARY_FILE, \"utf8\"));\n const keyCount = summary.newKeys.length;\n const localeRows = summary.updatedLocales\n .map(({ locale, count }) => `| \\`${locale}\\` | ${count} |`)\n .join(\"\\n\");\n const body = [\n \"### 🌐 I18n autofill completed\",\n \"\",\n `✅ Added translations for **${keyCount}** new \\`${summary.sourceLocale}\\` i18n ${keyCount === 1 ? \"key\" : \"keys\"}.`,\n \"\",\n \"| Locale | Added entries |\",\n \"| --- | ---: |\",\n localeRows,\n ].join(\"\\n\");\n\n fs.writeFileSync(process.env.BODY_FILE, `${body}\\n`);\n NODE\n\n gh pr comment \"$PR_NUMBER\" --repo \"$GITHUB_REPOSITORY\" --body-file \"$BODY_FILE\"\n\n - name: Comment push failure\n if: steps.patch.outputs.changed == 'true' && steps.patch.outputs.push_failed == 'true'\n env:\n GH_TOKEN: ${{ secrets.I18N_BOT_TOKEN || secrets.GITHUB_TOKEN }}\n PR_NUMBER: ${{ github.event.pull_request.number }}\n SUMMARY_FILE: ${{ runner.temp }}/i18n-summary.json\n PATCH_FILE: ${{ runner.temp }}/i18n-autofill.patch\n BODY_FILE: ${{ runner.temp }}/i18n-autofill-push-failed.md\n run: |\n node <<'NODE'\n const fs = require(\"node:fs\");\n\n const summary = JSON.parse(fs.readFileSync(process.env.SUMMARY_FILE, \"utf8\"));\n const patch = fs.readFileSync(process.env.PATCH_FILE, \"utf8\");\n const keyCount = summary.newKeys.length;\n const localeRows = summary.updatedLocales\n .map(({ locale, count }) => `| \\`${locale}\\` | ${count} |`)\n .join(\"\\n\");\n const patchPreview = patch.length > 60000\n ? `${patch.slice(0, 60000)}\\n\\n[Patch truncated in comment. Please check the workflow artifact/log for the full diff.]`\n : patch;\n const body = [\n \"### ⚠️ I18n autofill needs manual apply\",\n \"\",\n `I generated translations for **${keyCount}** new \\`${summary.sourceLocale}\\` i18n ${keyCount === 1 ? \"key\" : \"keys\"}, but could not push a patch to this PR branch.`,\n \"\",\n \"| Locale | Missing entries |\",\n \"| --- | ---: |\",\n localeRows,\n \"\",\n \"#### Patch preview\",\n \"```diff\",\n patchPreview,\n \"```\",\n ].join(\"\\n\");\n\n fs.writeFileSync(process.env.BODY_FILE, `${body}\\n`);\n NODE\n\n gh pr comment \"$PR_NUMBER\" --repo \"$GITHUB_REPOSITORY\" --body-file \"$BODY_FILE\"\n"}}}} |