Skip to content

circleci-dispatch.yml: gh pr comment/edit fail with 'not a git repository' after successfully triggering CircleCI #516

Closed

Description

@libravault-xyz

Summary

circleci-dispatch.yml's dispatch job successfully triggers the CircleCI pipeline (the curl to /pipeline/run returns a real pipeline number), but its three follow-up steps — "Comment with the run link", "Comment on failure to trigger", "Remove the triggering label" — all call gh pr comment / gh pr edit without --repo, and the job has no actions/checkout step. gh falls back to inferring the repo from the local git context, finds none, and fails:

failed to run git: fatal: not a git repository (or any of the parent directories): .git

Net effect: the pipeline does get triggered (verified — got a real pipeline number back), but the PR never gets the comment with the run link, and the circleci-job label never gets removed, so there's no visible confirmation it worked and the label sits there afterward.

Evidence

Triggered via the circleci-job label on PR #512 (2026-08-24): CircleCI returned {"state":"pending",...,"number":271}, but the "Comment with the run link" step then failed with the error above, followed by the same failure on the failure-comment and label-removal steps.

Fix

Add --repo ${{ github.repository }} to all three gh pr comment/gh pr edit calls (cheaper than adding a full checkout, since this job doesn't otherwise need the working tree).

Activity

  1. added
    bug
    on Aug 24, 2026
  2. added
    status:ready-for-dev
    status:in-progress
    on Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstatus:in-progressstatus:ready-for-dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions