SIGN IN SIGN UP

fix(analyzer): write artifacts outside git worktree (use runner.temp) (#6)

* fix(analyzer): write artifacts outside git worktree

Fifth analyzer run completed the entire pipeline (passes 1-3 + batch
building + pushing 2 of 3 batches to origin) but upload-artifact
reported "No files were found with the provided path: .analyzer-output/".

Root cause: the analyzer writes artifacts to the repo-rooted
`.analyzer-output/` directory. The batch-builder phase runs
`git checkout -b <branch> <baseTag>` three times (once per verdict),
switching HEAD between branches rooted at the upstream v3.17.0 tag.
Under some combination of bun's shell CWD handling and git checkout
edge cases, the untracked `.analyzer-output/` directory was lost
between the writes and the upload step.

Fix: use `${{ runner.temp }}/analyzer-output` for both OUTPUT_DIR
and the upload/read paths. runner.temp is outside the git worktree,
so git operations cannot affect it. The upload step, the Create
analysis issue step, and the Open draft PRs for batches step all
reference the same path via the OUTPUT_DIR env var.

Also enable Issues on the Vacbo/oh-my-opencode repo via:
  gh api -X PATCH repos/Vacbo/oh-my-opencode -f has_issues=true
(repo setting, not captured in this commit, but noted here for
the audit trail.)

* fix(analyzer): centralize ANALYZER_OUTPUT_DIR + add env guards

Review findings on PR #6 (Copilot x2, Augment x1):

1. runner.temp duplicated across 4 steps (Run pipeline, Upload,
   Create issue, Open PRs). Risk of drift when the path changes.
   Solution: export ANALYZER_OUTPUT_DIR once to $GITHUB_ENV in a
   dedicated setup step, then reference ${{ env.ANALYZER_OUTPUT_DIR }}
   everywhere. Using $GITHUB_ENV rather than job-level env because
   the runner context is only available at step scope.

2. github-script steps used process.env.OUTPUT_DIR without checking
   if it was set. If the wiring ever breaks, path.join(undefined, ...)
   throws an unhelpful TypeError. Add explicit check:
     if (!outputDir) {
       core.setFailed('OUTPUT_DIR env var is empty. Check...');
       return;
     }

No functional change; pipeline path is still runner.temp/analyzer-output.
V
Vacbo committed
435180428f65d1b1b16171427cba1161977d23d5
Parent: 9c5361f
Committed by GitHub <noreply@github.com> on 4/17/2026, 6:30:53 PM