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
@@ -997,9 +1001,19 @@ async function updateProject(output, temporaryIdMap) {
997
1001
* @param {number} [config.max] - Maximum number of update_project items to process
998
1002
* @param {Array<Object>} [config.views] - Views to create from configuration
999
1003
* @param {Array<Object>} [config.field_definitions] - Field definitions to create from configuration
1004
+
* @param {Object} githubClient - GitHub client (Octokit instance) to use for API calls
1000
1005
* @returns {Promise<Function>} Message handler function
1001
1006
*/
1002
-
asyncfunctionmain(config={}){
1007
+
asyncfunctionmain(config={},githubClient=null){
1008
+
// Use the provided github client, or fall back to the global github object
1009
+
// The global github object is available when running via github-script action
1010
+
// @ts-ignore - global.github is set by setupGlobals() from github-script context
1011
+
constgithub=githubClient||global.github;
1012
+
1013
+
if(!github){
1014
+
thrownewError("GitHub client is required but not provided. Either pass a github client to main() or ensure global.github is set by github-script action.");
1015
+
}
1016
+
1003
1017
// Extract configuration
1004
1018
// Default is intentionally configurable via safe-outputs.update-project.max,
1005
1019
// but we keep a sane global default to avoid surprising truncation.
@@ -1113,7 +1127,7 @@ async function main(config = {}) {
0 commit comments