santree 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -603,7 +603,7 @@ export default function Dashboard() {
603
603
  if (!prTemplate) {
604
604
  dispatch({
605
605
  type: "PR_CREATE_ERROR",
606
- error: "No PR template found at .github/pull_request_template.md",
606
+ error: "No PR template found (checked .github/, docs/, and repo root)",
607
607
  });
608
608
  return;
609
609
  }
@@ -56,7 +56,7 @@ export default function PR({ options }) {
56
56
  const prTemplate = getPRTemplate();
57
57
  if (!prTemplate) {
58
58
  setStatus("error");
59
- setMessage("No PR template found at .github/pull_request_template.md");
59
+ setMessage("No PR template found (checked .github/, docs/, and repo root)");
60
60
  setTimeout(() => exit(), 100);
61
61
  return;
62
62
  }
@@ -31,8 +31,10 @@ export declare function pushBranch(branchName: string, force?: boolean): boolean
31
31
  */
32
32
  export declare function createPR(title: string, baseBranch: string, headBranch: string, bodyFile?: string): number;
33
33
  /**
34
- * Fetch the pull request template from the repo's .github/pull_request_template.md.
35
- * Runs: `gh api repos/{owner}/{repo}/contents/.github/pull_request_template.md --jq .content`
34
+ * Fetch the pull request template from the repo.
35
+ * Checks all standard locations and casings that GitHub supports:
36
+ * .github/, docs/, and repo root — with both lowercase and uppercase filenames.
37
+ * https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository
36
38
  * Returns the decoded template content, or null if none exists.
37
39
  */
38
40
  export declare function getPRTemplate(): string | null;
@@ -71,15 +71,28 @@ export function createPR(title, baseBranch, headBranch, bodyFile) {
71
71
  }
72
72
  }
73
73
  /**
74
- * Fetch the pull request template from the repo's .github/pull_request_template.md.
75
- * Runs: `gh api repos/{owner}/{repo}/contents/.github/pull_request_template.md --jq .content`
74
+ * Fetch the pull request template from the repo.
75
+ * Checks all standard locations and casings that GitHub supports:
76
+ * .github/, docs/, and repo root — with both lowercase and uppercase filenames.
77
+ * https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository
76
78
  * Returns the decoded template content, or null if none exists.
77
79
  */
78
80
  export function getPRTemplate() {
79
- const output = run(`gh api repos/{owner}/{repo}/contents/.github/pull_request_template.md --jq .content`);
80
- if (!output)
81
- return null;
82
- return Buffer.from(output, "base64").toString("utf-8");
81
+ const paths = [
82
+ ".github/pull_request_template.md",
83
+ ".github/PULL_REQUEST_TEMPLATE.md",
84
+ "docs/pull_request_template.md",
85
+ "docs/PULL_REQUEST_TEMPLATE.md",
86
+ "pull_request_template.md",
87
+ "PULL_REQUEST_TEMPLATE.md",
88
+ ];
89
+ for (const path of paths) {
90
+ const output = run(`gh api repos/{owner}/{repo}/contents/${path} --jq .content`);
91
+ if (output) {
92
+ return Buffer.from(output, "base64").toString("utf-8");
93
+ }
94
+ }
95
+ return null;
83
96
  }
84
97
  /**
85
98
  * Fetch CI check results for a pull request (async).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "santree",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Git worktree manager",
5
5
  "license": "MIT",
6
6
  "author": "Santiago Toscanini",