File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39480,6 +39480,12 @@ async function cloneRepository(options) {
3948039480 ]);
3948139481}
3948239482async function syncChanges(options) {
39483+ if (!options.token) {
39484+ throw new Error("GitHub token is required for syncing changes.");
39485+ }
39486+ if (!options.branch) {
39487+ throw new Error("Branch name is required for syncing changes.");
39488+ }
3948339489 const octokit = github.getOctokit(options.token);
3948439490 const [owner, repo] = options.repository.split("/");
3948539491 try {
Original file line number Diff line number Diff line change @@ -266,11 +266,18 @@ async function cloneRepository(options: SyncOptions): Promise<void> {
266266}
267267
268268async function syncChanges ( options : SyncOptions ) : Promise < void > {
269- const octokit = github . getOctokit ( options . token ! ) ;
269+ if ( ! options . token ) {
270+ throw new Error ( "GitHub token is required for syncing changes." ) ;
271+ }
272+ if ( ! options . branch ) {
273+ throw new Error ( "Branch name is required for syncing changes." ) ;
274+ }
275+
276+ const octokit = github . getOctokit ( options . token ) ;
270277 const [ owner , repo ] = options . repository . split ( "/" ) ;
271278
272279 try {
273- const workingBranch = options . branch ! ;
280+ const workingBranch = options . branch ;
274281
275282 if ( options . autoMerge ) {
276283 core . info (
You can’t perform that action at this time.
0 commit comments