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
|
|
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
|
|
59
|
+
setMessage("No PR template found (checked .github/, docs/, and repo root)");
|
|
60
60
|
setTimeout(() => exit(), 100);
|
|
61
61
|
return;
|
|
62
62
|
}
|
package/dist/lib/github.d.ts
CHANGED
|
@@ -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
|
|
35
|
-
*
|
|
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;
|
package/dist/lib/github.js
CHANGED
|
@@ -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
|
|
75
|
-
*
|
|
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
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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).
|