Skip to content

ci: skip Deno lint/fmt/test when repo has no Deno targets#62

Open
hyperpolymath wants to merge 1 commit into
mainfrom
chore/ci-deno-exclude-phoenix-assets
Open

ci: skip Deno lint/fmt/test when repo has no Deno targets#62
hyperpolymath wants to merge 1 commit into
mainfrom
chore/ci-deno-exclude-phoenix-assets

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

The `rescript-deno-ci.yml` build job has been failing on `main` since at least 2026-05-30 because it runs `deno lint` / `deno fmt --check` / `deno test` repo-wide. There is no Deno code in this repository — `deno lint` was reaching the Phoenix browser-bundled JS (`assets/js/app.js`) and the Tailwind config, flagging legitimate Phoenix patterns (`window.*`, `prefer-const` on top-level `let`, `no-prototype-builtins`). 24 errors with no constructive fix.

This is a pre-existing CI failure pattern that affects every PR; not introduced by any composer PR but currently red on PRs #60#61 (and probably all open PRs).

Changes

  • New `deno.json` scopes both `lint` and `fmt` to anything outside the Phoenix asset pipeline, build cache, deps cache and `priv/static`. Documented inline.
  • `rescript-deno-ci.yml` gains a "Detect Deno target files" step that decides whether the lint/fmt/test/check stages have work to do. The four Deno stages now run conditionally on that detection.

Why guard at the workflow level instead of just `deno.json`

`deno lint` exits non-zero with "No target files found" even when `deno.json` scopes everything out. Without the workflow guard, the job would still be red.

Effect

  • On this repo (no `.ts` files outside `assets/`), the four Deno stages skip cleanly and the build job goes green.
  • The day a real Deno script lands somewhere outside the asset pipeline, the detection flips to `true` and the stages run normally.

Verification

  • The four `deno.json` exclude patterns match what the Phoenix asset pipeline owns.
  • `deno lint` locally (Deno 2.7.14) confirms "No target files found" exits 1 — matches the observed CI behaviour, so the workflow guard is necessary.

Why a separate PR

This is a one-file workflow fix plus a one-file `deno.json`. Splitting it out lets you merge it directly to `main` (no composer-stack base) so every other PR's build check goes green on next push.

Generated with Claude Code.

The rescript-deno-ci.yml "build" job has been failing on main since at
least 2026-05-30 because it runs `deno lint` and `deno fmt --check`
repo-wide. There is no Deno code in this repository — Deno was
reaching the Phoenix browser-bundled JS (assets/js/app.js) and the
Tailwind config, flagging legitimate Phoenix patterns (window.*,
prefer-const on top-level let, no-prototype-builtins). 24 errors,
no fix.

Changes
  - New deno.json scopes both lint and fmt to anything outside the
    Phoenix asset pipeline, build cache, deps cache and priv/static.
    Documented inline so future maintainers know why it exists.
  - rescript-deno-ci.yml gains a "Detect Deno target files" step that
    decides whether the lint/fmt/test/check stages have work to do.
    The four Deno stages now run conditionally on that detection so a
    repo with no .ts files outside the asset pipeline is a clean no-op
    instead of an exit-1 cascade.

Why guard at the workflow level instead of just deno.json
  - `deno lint` exits non-zero with "No target files found" even when
    deno.json scopes everything out. Without the workflow guard the
    job would still be red.

Effect
  - On this repo (no .ts files), the four Deno stages skip cleanly and
    the build job goes green.
  - The day a real Deno script lands somewhere outside assets/, the
    detection flips to true and the stages run normally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 65 issues detected

Severity Count
🔴 Critical 3
🟠 High 12
🟡 Medium 50

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in boj-build.yml",
    "type": "missing_timeout_minutes",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "missing_timeout_minutes",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in container-policy.yml",
    "type": "missing_timeout_minutes",
    "file": "container-policy.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant