Skip to content

Commit 0fe2d02

Browse files
committed
feat(nx-ghpages): add support for passing GH_TOKEN or GITHUB_TOKEN via env to auth with remote
1 parent 1306ceb commit 0fe2d02

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/nx-ghpages/src/executors/deploy/executor.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ export default async function deployExecutor(options: BuildExecutorSchema) {
3030
logger.info(`Creating CNAME file for ${options.CNAME} in ${directory}`);
3131
writeFileSync(join(directory, 'CNAME'), options.CNAME);
3232
}
33+
const envToken = process.env.GH_TOKEN ?? process.env.GITHUB_TOKEN;
34+
if (envToken) {
35+
options.remote = options.remote.replace(
36+
'https://',
37+
`https://github-actions:${envToken}@`,
38+
);
39+
}
3340

3441
logger.info('Setting up git remote');
3542

0 commit comments

Comments
 (0)