diff --git a/.github/workflows/ci-lint-format.yaml b/.github/workflows/ci-lint-format.yaml index c44406646ce..cc7cd6774af 100644 --- a/.github/workflows/ci-lint-format.yaml +++ b/.github/workflows/ci-lint-format.yaml @@ -61,7 +61,17 @@ jobs: - name: Verify architecture contracts id: architecture if: ${{ !cancelled() && steps.setup.outcome == 'success' && hashFiles('tools/architecture/src/cli.ts') != '' }} - run: pnpm architecture:check --report "$RUNNER_TEMP/architecture-findings.md" + # PR heads branched before --report existed reject it; drop the fallback once those have rebased. + run: | + findings="$RUNNER_TEMP/architecture-findings.md" + probe=$(GITHUB_ACTIONS= pnpm --silent architecture:check --report= 2>&1 || true) + if grep -q -- '--report requires a file path' <<< "$probe"; then + pnpm architecture:check --report "$findings" + else + echo "::warning::This PR head's architecture CLI predates --report; rebase onto main to get findings in the PR report." + echo 'Findings are in the workflow run log and annotations; this PR head predates `--report`.' > "$findings" + pnpm architecture:check + fi - name: Check server facts on changed lines env: