Add issue-triage-pr workflow with ability to make PRs#169
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/ai i dont think we can do optional per input, just make it mostly the same as issue-triage but with the ability to make PRs too |
|
Implemented your requested adjustment and pushed a follow-up commit to this PR branch. What changed
Validation
What is this? | From workflow: PR Assistant Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #169 |
|
/ai Please run a git diagnostics-only investigation in this PR run and report exact command outputs in a single comment. Goal: determine whether Important:
Run exactly:
echo "event=$GITHUB_EVENT_NAME"
echo "ref=$GITHUB_REF"
echo "ref_name=$GITHUB_REF_NAME"
echo "head_ref=$GITHUB_HEAD_REF"
git rev-parse --abbrev-ref HEAD
git rev-parse HEAD
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
echo "branch=$BRANCH"
git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; echo "origin_branch_ref_exists_exit=$?"
git show-ref --verify --quiet "refs/remotes/origin/main"; echo "origin_main_ref_exists_exit=$?"
git for-each-ref --format='%(refname:short)' refs/remotes/origin
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then
echo "using origin/$BRANCH base candidate"
git rev-list --count "origin/$BRANCH..$BRANCH"
else
echo "origin/$BRANCH missing"
fi
git fetch origin main
MB="$(git merge-base origin/main "$BRANCH")"
echo "merge_base=$MB"
git rev-list --count "$MB..$BRANCH"
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then
echo "subjects for origin/$BRANCH..$BRANCH"
git format-patch "origin/$BRANCH..$BRANCH" --stdout | sed -n 's/^Subject: /Subject: /p'
fi
echo "subjects for merge-base..$BRANCH"
MB="$(git merge-base origin/main "$BRANCH")"
git format-patch "$MB..$BRANCH" --stdout | sed -n 's/^Subject: /Subject: /p'In your response:
|
There was a problem hiding this comment.
Request changes: please enforce automatic-prs at the safe-output configuration layer so PR creation is impossible when callers set it to false.
What is this? | From workflow: PR Review Agent
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #169
|
|
||
| - **CAN**: Read files, search code, run tests and commands, and comment on the issue. | ||
| - **OPTIONAL**: If `automatic-prs` is `true`, you may implement straightforward fixes and call `create_pull_request` once. | ||
| - **DEFAULT**: If `automatic-prs` is not `true`, this is investigation and planning only and your only output is an issue comment. |
There was a problem hiding this comment.
[MEDIUM] automatic-prs is prompt-only, not enforced in safe outputs
The workflow advertises analysis-only behavior when automatic-prs is not true, but create-pull-request is imported unconditionally and remains callable regardless of input. A concrete failure mode is the agent creating a PR even when callers set automatic-prs: "false", which breaks the caller-controlled contract.
Please gate create-pull-request in frontmatter (for example via safe-outputs config with max: 0 when inputs.automatic-prs != 'true') so the restriction is technically enforced, not only instruction-based.
|
Diagnostics run completed with the exact commands requested.
What is this? | From workflow: PR Assistant Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #169 |
|
@copilot the other agent failed, remove the input for making a pr and just make it mostly the same as issue-triage but with the ability to make PRs too |
|
@strawgate I've opened a new pull request, #179, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Pull request overview
This PR adds a new "Issue Triage (Optional PRs)" workflow that extends the existing issue triage functionality with optional automatic PR creation. The workflow is controlled by a new automatic-prs input that defaults to "false", maintaining analysis-only behavior by default while allowing callers to enable PR creation for straightforward fixes.
Changes:
- New workflow package with caller-controlled PR creation capability via
automatic-prsanddraft-prsinputs - Workflow definition placed in
github/workflows/pending maintainer relocation to.github/workflows/ - Documentation table updated to list the new workflow alongside existing issue triage workflow
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| github/workflows/gh-aw-issue-triage-pr.md | Workflow definition with automatic-prs input controlling PR creation behavior |
| gh-agent-workflows/issue-triage-pr/example.yml | Example trigger configuration demonstrating workflow inputs |
| gh-agent-workflows/issue-triage-pr/README.md | Documentation of workflow purpose, inputs, and safe outputs |
| docs/workflows/gh-agent-workflows.md | Added table entry for new workflow in human-coordinated workflows section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| types: [opened] | ||
|
|
||
| permissions: | ||
| contents: read |
There was a problem hiding this comment.
The example.yml file has contents: read permission, but workflows that create pull requests need contents: write permission to create branches. All other workflows that use create_pull_request (mention-in-issue, bug-exterminator, small-problem-fixer, etc.) have contents: write. This permission is needed when automatic-prs is enabled.
| contents: read | |
| contents: write |
…_request (#179) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
|
CI failed in Root cause (from the failing step
I reproduced this locally on commit
Recommended fix:
I did not push changes from this automation because the required fix is entirely in What is this? | From workflow: PR Checks Fixer Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
Adds a variation of issue-triage that has access to making PRs