You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"One or multiple arrays in the form of 'repo-owner/repo-name'. 'repo-owner/*' will find all repositories for one owner. '*' will find all repositories the user has access to",
Copy file name to clipboardExpand all lines: index.js
+5-23Lines changed: 5 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,3 @@
1
-
import{resolve}from"path";
2
1
import{appendFileSync}from"fs";
3
2
4
3
import{Octokit}from"@octoherd/octokit";
@@ -22,10 +21,10 @@ const levelColor = {
22
21
* Find all releases in a GitHub repository or organization after a specified date
23
22
*
24
23
* @param {object} options
24
+
* @param {function} options.octoherdScript Path to script to run against a repository
25
+
* @param {string[]} options.octoherdRepos Cache responses for debugging
25
26
* @param {string} options.octoherdToken Personal Access Token: Requires the "public_repo" scope for public repositories, "repo" scope for private repositories.
26
-
* @param {string} options.octoherdScript Path to script to run against a repository
27
-
* @param {string} options.octoherdCache Array of repository names in the form of "repo-owner/repo-name". To match all repositories for an owner, pass "repo-owner/*"
28
-
* @param {boolean} options.octoherdRepos Cache responses for debugging
27
+
* @param {boolean} options.octoherdCache Array of repository names in the form of "repo-owner/repo-name". To match all repositories for an owner, pass "repo-owner/*"
29
28
*/
30
29
exportasyncfunctionoctoherd(
31
30
options={
@@ -78,22 +77,6 @@ export async function octoherd(
78
77
},
79
78
});
80
79
81
-
letuserScript;
82
-
constpath=resolve(process.cwd(),octoherdScript);
83
-
84
-
octokit.log.info("Loading script at %s",octoherdScript);
85
-
86
-
try{
87
-
userScript=(awaitimport(path)).script;
88
-
}catch(error){
89
-
octokit.log.error(error.stack);
90
-
thrownewError(`[octoherd] ${octoherdScript} script could not be found`);
91
-
}
92
-
93
-
if(!userScript){
94
-
thrownewError(`[octoherd] no "script" exported at ${path}`);
95
-
}
96
-
97
80
if(octoherdRepos.length===0){
98
81
thrownewError("[octoherd] No repositories provided");
99
82
}
@@ -110,13 +93,12 @@ export async function octoherd(
0 commit comments