send-pr

Automates GitHub pull request creation and updates via gh after formatting with make fmt.

1.1k|367|Updated Apr 8, 2019
One-click install
npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill send-pr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: send-pr
Source: https://github.com/GoogleCloudPlatform/k8s-config-connector/tree/main/.gemini/skills/send-pr
Command: npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill send-pr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, git, gh, make, and includes scripts (resource) components.

What problem does it solve?

Sending a PR often fails due to formatting drift, forgotten commits, or duplicate PRs for the same branch; this skill streamlines the process so changes are formatted, pushed, and submitted consistently.

Core Features & Use Cases

  • Run formatting validation before PR submission: Executes make fmt and blocks sending if formatting changes would be required.
  • Publish the branch and reuse existing PRs: Pushes the current non-main branch and then either creates a new PR or edits the existing one for that branch.
  • Use GitHub CLI for deterministic PR operations: Uses gh to interact with GitHub and update title/body from provided inputs.

Quick Start

Run ./.gemini/skills/send-pr/scripts/send-pr.sh --title "Brief PR Title" --body /root/.gemini/tmp/k8s-config-connector/pr-body.txt after writing your PR description to a temporary file.

Frequently Asked Questions about send-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely create a GitHub pull request from a local branch using gh cli?

To safely create a GitHub pull request, the script validates no uncommitted changes exist, runs make fmt, pushes the branch, and uses gh pr create with a required title and body file.

Can I update an existing GitHub pull request with gh cli?

Yes, you can update an existing GitHub pull request. The script pushes the current branch and edits the existing PR for that branch using gh pr edit, updating the title and body from provided inputs.

Why does my pull request workflow fail due to code formatting drift?

Pull request workflows fail due to formatting drift when unformatted code is pushed. This script prevents this by executing make fmt and blocking PR submission if formatting introduces new diffs.

Do I need to commit all changes before automating a git push to GitHub?

Yes, you must commit all changes before automating a git push. The script validates that no uncommitted changes exist in your working directory and disallows operations from main or master branches.

How do I pass the PR body when using gh cli to create a pull request?

You pass the PR body by providing an external body file path. The script requires both a PR title and a path to a temporary file containing the PR description to execute gh pr create or gh pr edit.

What is the best way to enforce CI hygiene before submitting a GitHub PR?

The best way to enforce CI hygiene before submitting a GitHub PR is to automate formatting checks. This script executes make fmt, verifies no new diffs are introduced, and safely pushes the formatted branch.