Skip to content

Commit 6d66f48

Browse files
fix: enhance GitHub authentication to support GITHUB_TOKEN
1 parent 66425a1 commit 6d66f48

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/release/module-automation/commons.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@ async function githubAuthentication(moduleInfo) {
204204
""
205205
)}`
206206
);
207-
await execShellCommand(`echo "${process.env.GH_PAT}" | gh auth login --with-token`);
207+
// If GH_TOKEN or GITHUB_TOKEN is set, gh CLI uses it automatically - no login needed
208+
// Otherwise, authenticate using GH_PAT
209+
if (!process.env.GH_TOKEN && !process.env.GITHUB_TOKEN) {
210+
await execShellCommand(`echo "${process.env.GH_PAT}" | gh auth login --with-token`);
211+
}
208212
}
209213

210214
async function cloneRepo(githubUrl, localFolder, branchName = "main") {

0 commit comments

Comments
 (0)