Skip to content

docs-quality-sweep master: pass --repo to gh workflow run - #6272

Merged
theletterf merged 1 commit into
mainfrom
fix-master-add-repo-flag
May 5, 2026
Merged

theletterf merged 1 commit into
mainfrom
fix-master-add-repo-flag

Conversation

@theletterf

Copy link
Copy Markdown
Member

Summary

The master dispatcher introduced in #6271 fails on the first gh workflow run invocation:

```
→ dispatching docs-frontmatter-sweep.yml
failed to run git: fatal: not a git repository (or any of the parent directories): .git
##[error]Process completed with exit code 1.
```

Failing run: https://github.com/elastic/docs-content/actions/runs/25373495676/job/74402614432

Cause

gh workflow run resolves the target repository from the local git remote when no --repo flag is given. The master skips actions/checkout deliberately — it's a thin dispatcher that doesn't need the source tree — so there's no .git directory and the command exits 1 before doing anything.

Fix

Add --repo "${{ github.repository }}" to all four gh workflow run invocations (the fire_with_default_inputs helper plus the typos / staleness / coherence blocks). The runtime expression ${{ github.repository }} resolves to elastic/docs-content, so gh CLI skips the local-remote inference entirely.

Same effect as adding actions/checkout@v6 to the step but cheaper — no clone, no filesystem I/O for what's a sub-second dispatch script.

Test plan

  • Merge.
  • Dispatch docs-quality-sweep.yml with sweeps=typos. Expect:
    • master finishes in seconds with → dispatching docs-typos-sweep.yml printed (no "fatal: not a git repository");
    • a separate Docs typos sweep run appears in the Actions tab.
  • Dispatch with sweeps=all. Expect seven sub-runs in the Actions tab, each independent.

🤖 Generated with Claude Code

The fan-out step in the master dispatcher fails on the very first
sub-workflow with `fatal: not a git repository (or any of the parent
directories): .git`. Cause: `gh workflow run` resolves the target
repository from the local git remote when no `--repo` flag is
provided, but the master skips checkout (it's a thin dispatch step
that doesn't need the source tree). Without a `.git` directory the
command exits 1.

Failing run: https://github.com/elastic/docs-content/actions/runs/25373495676/job/74402614432

Pass `--repo "${{ github.repository }}"` to every `gh workflow run`
call so the target repo is explicit and gh CLI doesn't try to infer
it from a non-existent local checkout. Same effect as adding
`actions/checkout@v6` to the step but cheaper (no clone, no
filesystem I/O).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@theletterf
theletterf requested a review from a team as a code owner May 5, 2026 11:28
@theletterf
theletterf requested a review from Mpdreamz May 5, 2026 11:28
@theletterf
theletterf merged commit fe13828 into main May 5, 2026
9 checks passed
@theletterf
theletterf deleted the fix-master-add-repo-flag branch May 5, 2026 11:29
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

  • Review docs changes (docs-review). Status: not started.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

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