whyisjake / whyisjake/agentic-deployment-template

setup.sh overstates how GitHub picks named PR templates

Open
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
8
Forks
4
Avg merge
23m
Merged PRs (30d)
18

Description

setup.sh tells users GitHub will use the named PR template automatically. The docs don't support that.

Raised by @pandah3 while reviewing the GOOP/Parker integration (Automattic/vip-go-api#7369):

Since this is in the PULL_REQUEST_TEMPLATE/ folder rather than a single pull_request_template.md file, it'll only show up if a user opens a PR with ?template=agent-generated.md.

What the script currently claims

scripts/setup.sh:141-147:

# GitHub supports multiple named PR templates in PULL_REQUEST_TEMPLATE/.
# If you have a flat .github/pull_request_template.md, both approaches work
# simultaneously — GitHub uses the named directory when it exists.

if [[ -f ".github/pull_request_template.md" ]]; then
  dim "  Found .github/pull_request_template.md — adding named PULL_REQUEST_TEMPLATE/ alongside it"
  dim "  (GitHub uses named templates when PULL_REQUEST_TEMPLATE/ exists; your existing template is unaffected)"
fi
Why that looks wrong

GitHub's docs say:

You can create a PULL_REQUEST_TEMPLATE/ subdirectory in any of the supported folders to contain multiple pull request templates, and use the template query parameter to specify the template that will fill the pull request body.

So a named template is specified via ?template=, not picked up automatically. The docs don't state the precedence when a flat pull_request_template.md and a PULL_REQUEST_TEMPLATE/ directory both exist — but "GitHub uses the named directory when it exists" is a stronger claim than anything documented, and if it's wrong it's backwards: the flat template is the one that auto-applies.

This needs testing on a scratch repo rather than reasoning from docs. I couldn't confirm the precedence either way.

What isn't broken

Agent-opened PRs do get the template content — agent-ready-trigger.yml:322 instructs the agent to read the file and use it:

- Use the template at .github/PULL_REQUEST_TEMPLATE/agent-generated.md if it exists

That path writes the body directly and never relies on GitHub's auto-application. So this is about human-opened PRs and, more importantly, about setup.sh telling adopters something that may not be true.

Suggested fix
  1. Test the actual behavior on a scratch repo (flat only / directory only / both).
  2. Correct the comment and the dim message to match.
  3. If named templates really do need ?template=, say so plainly and give users the link form — …/compare/main...branch?template=agent-generated.md — or reconsider whether this belongs at .github/pull_request_template.md for repos that don't already have one.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with scripts/setup.sh:141-147 and compare its claims with GitHub’s pull request template behavior. Test a scratch repository with a flat template, a named-template directory, and both configurations, then update the comment and dim message to match the observed behavior. Confirm the agent-opened path in agent-ready-trigger.yml:322 remains unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, shell
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.