mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-15 06:33:17 +08:00
feat: Remove warning about GITHUB_TOKEN (#108)
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
This commit is contained in:
parent
7b9b3b3f5f
commit
74f652acfd
@ -73,10 +73,8 @@ export async function setGithubToken(
|
|||||||
core.info('[INFO] setup GITHUB_TOKEN');
|
core.info('[INFO] setup GITHUB_TOKEN');
|
||||||
|
|
||||||
const context = github.context;
|
const context = github.context;
|
||||||
const payload = github.context.payload;
|
|
||||||
core.debug(`ref: ${context.ref}`);
|
core.debug(`ref: ${context.ref}`);
|
||||||
core.debug(`eventName: ${context.eventName}`);
|
core.debug(`eventName: ${context.eventName}`);
|
||||||
core.debug(`private: ${payload.repository?.private}`);
|
|
||||||
let isProhibitedBranch = false;
|
let isProhibitedBranch = false;
|
||||||
|
|
||||||
const ref = context.ref;
|
const ref = context.ref;
|
||||||
@ -89,17 +87,11 @@ export async function setGithubToken(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isPrivateRepository = payload.repository?.private;
|
|
||||||
if (inps.ExternalRepository) {
|
if (inps.ExternalRepository) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'GITHUB_TOKEN does not support to push to an external repository'
|
'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`;
|
return `https://x-access-token:${inps.GithubToken}@github.com/${publishRepo}.git`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user