Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/gh-aw-fragments/safe-output-create-pr.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
---
safe-inputs:
ready-to-make-pr:
description: "Run the PR readiness checklist before creating or updating a PR"
script: |
const fs = require('fs');
const find = (...paths) => paths.find(p => fs.existsSync(p)) || null;
const contributing = find('CONTRIBUTING.md', 'CONTRIBUTING.rst', 'docs/CONTRIBUTING.md', 'docs/contributing.md');
const prTemplate = find('.github/pull_request_template.md', '.github/PULL_REQUEST_TEMPLATE.md', '.github/PULL_REQUEST_TEMPLATE/pull_request_template.md');
const checklist = [];
if (contributing) checklist.push(`Review the contributing guide (${contributing}) before opening or updating a PR.`);
if (prTemplate) checklist.push(`Follow the PR template (${prTemplate}) for title, description, and validation notes.`);
checklist.push('Confirm the requested task is fully completed and validated before creating or pushing PR changes.');
return { status: 'ok', checklist, contributing_guide: contributing, pr_template: prTemplate };
safe-outputs:
create-pull-request:
draft: ${{ inputs.draft-prs != 'false' }}
---

Before calling `create_pull_request`, call `ready_to_make_pr` and apply its checklist.

## create-pull-request Limitations

- **Patch files**: Max 100 files per PR. If changes span more files, split into multiple focused PRs.
Expand All @@ -13,4 +28,4 @@ safe-outputs:
- **Committed changes required**: You must have locally committed changes before creating a PR (unless `allow_empty` is configured).
- **Base branch**: Must be configured in the safe-output config. The PR targets this branch.
- **Max per run**: Typically 1 PR creation per workflow run.
- You may not submit code that modifies files in `.github/workflows/`. Doing so will cause the submission to be rejected. If asked to modify workflow files, propose the change in a copy placed in a `github/` folder (without the leading period) and note in the PR that the file needs to be relocated by someone with workflow write access.
- You may not submit code that modifies files in `.github/workflows/`. Doing so will cause the submission to be rejected. If asked to modify workflow files, propose the change in a copy placed in a `github/` folder (without the leading period) and note in the PR that the file needs to be relocated by someone with workflow write access.
17 changes: 16 additions & 1 deletion .github/workflows/gh-aw-fragments/safe-output-push-to-pr.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
---
safe-inputs:
ready-to-make-pr:
description: "Run the PR readiness checklist before creating or updating a PR"
script: |
const fs = require('fs');
const find = (...paths) => paths.find(p => fs.existsSync(p)) || null;
const contributing = find('CONTRIBUTING.md', 'CONTRIBUTING.rst', 'docs/CONTRIBUTING.md', 'docs/contributing.md');
const prTemplate = find('.github/pull_request_template.md', '.github/PULL_REQUEST_TEMPLATE.md', '.github/PULL_REQUEST_TEMPLATE/pull_request_template.md');
const checklist = [];
if (contributing) checklist.push(`Review the contributing guide (${contributing}) before opening or updating a PR.`);
if (prTemplate) checklist.push(`Follow the PR template (${prTemplate}) for title, description, and validation notes.`);
checklist.push('Confirm the requested task is fully completed and validated before creating or pushing PR changes.');
return { status: 'ok', checklist, contributing_guide: contributing, pr_template: prTemplate };
safe-outputs:
push-to-pull-request-branch:
---

Before calling `push_to_pull_request_branch`, call `ready_to_make_pr` and apply its checklist.

## push-to-pull-request-branch Limitations

- **Patch size**: Max 1,024 KB by default. Keep changes focused — large refactors may exceed this.
Expand All @@ -15,4 +30,4 @@ Trying to resolve merge conflicts? Do NOT use `git merge` or `git rebase`. Inste
1. Compare the conflicting files between this PR branch and origin/main
2. Edit the files directly to incorporate the changes from main
3. Commit the changes as regular commits
4. Use push_to_pull_request_branch to push
4. Use push_to_pull_request_branch to push
Loading