Skip to content

helpers: Add clone-pr command#97

Merged
YorikSar merged 5 commits intomasterfrom
clone-nixpkgs-pr
May 1, 2026
Merged

helpers: Add clone-pr command#97
YorikSar merged 5 commits intomasterfrom
clone-nixpkgs-pr

Conversation

@YorikSar
Copy link
Copy Markdown
Contributor

Allows the user to clone any PR into another repo.
Also add --use-gh-token flag to use user's token from GITHUB_TOKEN env variable or gh auth token to not overcomplicate things with GH Apps.

Example usage for common use case of running Hydra jobset on upstream PR:

nix run .#helpers -- --use-gh-token clone-pr --body 'Clone of {html_url} for CI' --repo-full-name nixos-cuda/nixpkgs https://github.com/NixOS/nixpkgs/pull/513905

@YorikSar YorikSar requested a review from GaetanLepage April 29, 2026 15:06
@GaetanLepage
Copy link
Copy Markdown
Contributor

Amazing. Would there be a way to set options to sensible default so I can do:
nix run .#helpers -- clone-pr 666666?

@YorikSar
Copy link
Copy Markdown
Contributor Author

@GaetanLepage Sure, I've set defaults to what's in the description. But you still need to use URL for now, I'd need to add some code to deal with just PR number. I assumed that pasting an URL is easier than grabbing a number.

Copy link
Copy Markdown
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff LGTM overall. Thanks a lot for the feature!

@YorikSar YorikSar force-pushed the clone-nixpkgs-pr branch from cf38252 to 6799b7f Compare May 1, 2026 17:05
@YorikSar YorikSar enabled auto-merge (rebase) May 1, 2026 17:06
@YorikSar YorikSar merged commit ae7d67e into master May 1, 2026
9 checks passed
@YorikSar YorikSar deleted the clone-nixpkgs-pr branch May 1, 2026 17:08
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.

2 participants