Skip to content

Commit

Permalink
feat(nx-ghpages): add support for passing GH_TOKEN or GITHUB_TOKEN vi…
Browse files Browse the repository at this point in the history
…a env to auth with remote
  • Loading branch information
AgentEnder committed Jul 27, 2024
1 parent 1306ceb commit 0fe2d02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/nx-ghpages/src/executors/deploy/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export default async function deployExecutor(options: BuildExecutorSchema) {
logger.info(`Creating CNAME file for ${options.CNAME} in ${directory}`);
writeFileSync(join(directory, 'CNAME'), options.CNAME);
}
const envToken = process.env.GH_TOKEN ?? process.env.GITHUB_TOKEN;
if (envToken) {
options.remote = options.remote.replace(
'https://',
`https://github-actions:${envToken}@`,
);
}

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

Expand Down

0 comments on commit 0fe2d02

Please sign in to comment.