Skip to content

Add issue-triage-pr workflow with ability to make PRs#169

Merged
strawgate merged 3 commits intomainfrom
main-ef3ad89c0dd0de53
Feb 19, 2026
Merged

Add issue-triage-pr workflow with ability to make PRs#169
strawgate merged 3 commits intomainfrom
main-ef3ad89c0dd0de53

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Feb 19, 2026

Adds a variation of issue-triage that has access to making PRs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@strawgate
Copy link
Collaborator

/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

@github-actions
Copy link
Contributor Author

Implemented your requested adjustment and pushed a follow-up commit to this PR branch.

What changed

  • Removed the automatic-prs input and its gating behavior from github/workflows/gh-aw-issue-triage-pr.md.
  • Updated the prompt/constraints to keep issue triage behavior mostly aligned with issue-triage, while still allowing one straightforward, verified PR via create_pull_request.
  • Updated gh-agent-workflows/issue-triage-pr/example.yml to remove automatic-prs from with:.
  • Updated gh-agent-workflows/issue-triage-pr/README.md text and inputs table to match the new behavior.

Validation

  • Ran make lint-workflows successfully.

What is this? | From workflow: PR Assistant

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #169

@strawgate strawgate marked this pull request as ready for review February 19, 2026 22:03
@strawgate
Copy link
Collaborator

/ai Please run a git diagnostics-only investigation in this PR run and report exact command outputs in a single comment.

Goal: determine whether refs/remotes/origin/<current-pr-branch> exists at patch-generation time for this issue_comment-triggered run.

Important:

  • Do NOT call push_to_pull_request_branch or create_pull_request.
  • Do NOT modify files.
  • Only run commands and report outputs.

Run exactly:

  1. Basic context
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
  1. Remote ref presence checks
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
  1. Compare patch-base possibilities
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"
  1. Show what format-patch would include for each base
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:

  • Include raw outputs.
  • Then summarize in 3 bullets:
    1. did refs/remotes/origin/<branch> exist?
    2. which base includes only new commits vs old PR commits?
    3. whether this reproduces the 2-patch behavior.

Copy link
Contributor Author

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[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.

@github-actions
Copy link
Contributor Author

Diagnostics run completed with the exact commands requested.

1) Basic context
event=issue_comment
ref=refs/heads/main
ref_name=main
head_ref=
main
07a5a5252f5dc6dd7f20f5e2780eee5a0de5fa84
2) Remote ref presence checks
branch=main
origin_branch_ref_exists_exit=0
origin_main_ref_exists_exit=0
origin/main
3) Compare patch-base possibilities
using origin/main base candidate
0
From https://github.com/elastic/ai-github-actions
 * branch            main       -> FETCH_HEAD
merge_base=07a5a5252f5dc6dd7f20f5e2780eee5a0de5fa84
0
4) Show what format-patch would include for each base
subjects for origin/main..main
subjects for merge-base..main
  • refs/remotes/origin/(branch) existed for the checked-out branch (branch=main, exit 0).
  • In this run, both base strategies were identical (origin/main..main and merge-base..main) and each included 0 commits (no subjects).
  • This did not reproduce 2-patch behavior in the observed checkout state; output was empty for both patch ranges.

What is this? | From workflow: PR Assistant

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #169

@strawgate
Copy link
Collaborator

@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

Copy link
Contributor

Copilot AI commented Feb 19, 2026

@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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-prs and draft-prs inputs
  • 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
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
contents: read
contents: write

Copilot uses AI. Check for mistakes.
…_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>
@strawgate strawgate merged commit c9ad908 into main Feb 19, 2026
5 of 6 checks passed
@strawgate strawgate deleted the main-ef3ad89c0dd0de53 branch February 19, 2026 22:20
@github-actions
Copy link
Contributor Author

CI failed in Verify compiled workflows (job 64218067454) because make compile leaves the working tree dirty.

Root cause (from the failing step Ensure lock files are up to date): git status --porcelain reported regenerated files under .github/workflows/, including modified lock files and untracked trigger files such as:

  • .github/workflows/gh-aw-*.lock.yml (multiple modified)
  • .github/workflows/agentics-maintenance.yml (modified)
  • .github/workflows/trigger-agent-suggestions.yml (untracked)
  • .github/workflows/trigger-issue-triage-pr.yml (untracked)
  • .github/workflows/trigger-pr-ci-detective.yml (untracked)
  • .github/workflows/trigger-pr-ci-fixer.yml (untracked)
  • .github/workflows/trigger-release-update.yml (untracked)

I reproduced this locally on commit c8e995346150c89438d199780ff654ebbfc2b3d7:

  • make compile → succeeds
  • git status --short → shows the same .github/workflows/* modifications/untracked files

Recommended fix:

  1. Run make compile on this PR branch.
  2. Commit all resulting .github/workflows/* updates (including newly generated trigger-*.yml files).
  3. Push and re-run CI.

I did not push changes from this automation because the required fix is entirely in .github/workflows/ generated outputs.


What is this? | From workflow: PR Checks Fixer

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@strawgate strawgate changed the title Add issue-triage-pr workflow with caller-controlled auto PRs Add issue-triage-pr workflow with ability to make PRs Feb 20, 2026
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.

3 participants