Skip to content

Commit

Permalink
feat: Remove warning about GITHUB_TOKEN
Browse files Browse the repository at this point in the history
GitHub might have started to supporting to trigger the GitHub Pages build event by GITHUB_TOKEN on public repositories. (We can already use the token on private repositories.) Be careful, there is no official announcement about this by GitHub.

cf. #9
  • Loading branch information
peaceiris committed Feb 18, 2020
1 parent 1c50baa commit f009bab
Showing 1 changed file with 0 additions and 8 deletions.
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

0 comments on commit f009bab

Please sign in to comment.