Skip to main content

radius-create-pr

Automates GitHub pull request creation from the current branch

معلومات المصدر

المستودع
radius-project/radius
آخر نشاط في المصدر
٢١ أكتوبر ٢٠٢٦ في ١٩:٢٧
لغة SKILL.md المكتشفة
الإنجليزية
النجوم
١٬٦٧١
التفرعات
١٤٢

خيارات التثبيت

يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.

مراجعة ملفات المصدر

اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.

عرض SKILL.md

SKILL.md
تعليمات المصدر · معاينة للقراءة فقط
name
radius-create-pr
description
Automates GitHub pull request creation from the current branch
disable-model-invocation
true
# Create GitHub Pull Request Create a pull request from the current branch following the steps below. ## Determining the Default Branch When working with forks, the default branch must come from the correct remote: - If `upstream` exists in `git remote -v`: run `git remote show upstream` and parse the output to find the `HEAD branch` - Otherwise: run `git remote show origin` and parse the output to find the `HEAD branch` > [!TIP] > On Linux or macOS for precise output parsing, consider using: `git remote show <your-remote-name> | grep 'HEAD branch'` > On Windows with PowerShell, you can use: `git remote show <your-remote-name> | Select-String 'HEAD branch'` ## Steps ### Step 1: Validate Branch State Stop and inform the user if any of these conditions exist: - Current branch has no remote tracking branch (`git rev-parse --abbrev-ref --symbolic-full-name "@{u}"`) - Uncommitted changes exist (`git status --porcelain`) - Unpushed commits exist (`git rev-list --count "@{u}..HEAD"` returns > 0) ### Step 2: Load PR Template Check for a PR template at these locations (in order): - `.github/PULL_REQUEST_TEMPLATE.md` - `.github/pull_request_template.md` - `docs/PULL_REQUEST_TEMPLATE.md` - `PULL_REQUEST_TEMPLATE.md` Use the first template found to structure the PR description. ### Step 3: Generate PR Content Analyze the changes using `git diff` and `git log` against the default branch. **PR Title Requirements:** - Maximum 80 characters - Use `<type>[optional scope][!]: <description>` with a lowercase type - Read the [PR title guide](../../../docs/contributing/contributing-pull-requests/README.md#3-use-a-conventional-commit-pull-request-title) and use its allowed types - Use noun phrases in the description, for example `feat(api): authentication improvements` **PR Description:** - Follow the PR template structure if one exists - Preserve checkboxes from the template (do not convert to bullets) - If no template: summarize changes, list modified files, include relevant commit context ### Step 4: Create the Pull Request Create the PR using the GitHub MCP tool, falling back to `gh pr create` if unavailable. - **head**: current branch - **base**: default branch (from Step 1) ### Step 5: Report Result Display the PR URL: ```text ✅ Pull request created successfully! 🔗 URL: [PR_URL] ``` ## Error Handling Stop immediately on any failure with a clear error message. Common errors: - Branch not pushed to remote - Uncommitted or unpushed changes - PR already exists for this branch - Insufficient GitHub permissions
عرض على GitHub