Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove warning about GITHUB_TOKEN #108

Merged
merged 1 commit into from
Feb 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/set-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ export async function setGithubToken(
core.info('[INFO] setup GITHUB_TOKEN');

const context = github.context;
const payload = github.context.payload;
core.debug(`ref: ${context.ref}`);
core.debug(`eventName: ${context.eventName}`);
core.debug(`private: ${payload.repository?.private}`);
let isProhibitedBranch = false;

const ref = context.ref;
Expand All @@ -89,17 +87,11 @@ export async function setGithubToken(
}
}

const isPrivateRepository = payload.repository?.private;
if (inps.ExternalRepository) {
throw new Error(
'GITHUB_TOKEN does not support to push to an external repository'
);
}
if (isPrivateRepository === false) {
core.warning(
'GITHUB_TOKEN does not support to trigger the GitHub Pages build event on a public repository'
);
}

return `https://x-access-token:${inps.GithubToken}@github.com/${publishRepo}.git`;
}
Expand Down