Repository navigation
fix(admin): use the shared page header on list pages #2083
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Env Types | |
| on: | |
| pull_request: | |
| branches: [main] | |
| merge_group: | |
| # Regenerates every committed emdash-env.d.ts from its project's seed. Runs | |
| # with the default read-only token; this workflow never pushes. The companion | |
| # "Env Types — Apply" workflow (triggered by workflow_run) pushes the patch | |
| # back to the PR branch with elevated permissions, isolated from PR-authored | |
| # code. Keep the workflow unfiltered at the event level so the Generate check | |
| # is reported for every PR; the first step skips the build when the changed | |
| # paths cannot affect the generated files. | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| generate: | |
| name: Generate | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Detect relevant changes | |
| id: changes | |
| if: github.event_name == 'pull_request' | |
| uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2 | |
| with: | |
| filters: | | |
| relevant: | |
| - 'packages/core/src/**' | |
| - 'packages/core/tsdown.config.ts' | |
| - '**/emdash-env.d.ts' | |
| - '**/seed.json' | |
| - '**/seed/**' | |
| - '**/.emdash/**' | |
| - '**/package.json' | |
| - 'scripts/env-types.mjs' | |
| - 'pnpm-lock.yaml' | |
| - 'pnpm-workspace.yaml' | |
| - '.github/workflows/env-types.yml' | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true' | |
| with: | |
| persist-credentials: false | |
| - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 | |
| if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true' | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true' | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true' | |
| run: pnpm install --frozen-lockfile | |
| - if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true' | |
| run: pnpm build | |
| - name: Regenerate emdash-env.d.ts files | |
| if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true' | |
| run: node scripts/env-types.mjs | |
| - name: Detect drift | |
| if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true' | |
| id: drift | |
| env: | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| if git diff --quiet -- '*emdash-env.d.ts'; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| echo "No drift — committed emdash-env.d.ts files are current." | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| mkdir -p env-types-out | |
| git diff --binary -- '*emdash-env.d.ts' > env-types-out/env-types.patch | |
| echo "$PR_NUMBER" > env-types-out/pr-number | |
| echo "Drift detected — uploading patch for the Apply workflow." | |
| git diff --stat -- '*emdash-env.d.ts' | |
| fi | |
| - name: Upload patch artifact | |
| if: github.event_name == 'pull_request' && steps.drift.outputs.changed == 'true' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: env-types-patch | |
| path: env-types-out/ | |
| retention-days: 7 | |
| if-no-files-found: error | |
| - name: Require updated files on pull requests | |
| if: github.event_name == 'pull_request' && steps.drift.outputs.changed == 'true' | |
| run: | | |
| echo "::error::emdash-env.d.ts files are stale; the Env Types — Apply workflow will update the PR branch." | |
| exit 1 | |
| - name: Require committed files in the merge queue | |
| if: github.event_name == 'merge_group' && steps.drift.outputs.changed == 'true' | |
| run: | | |
| echo "::error::emdash-env.d.ts files are stale on the merge candidate" | |
| exit 1 |