feat: enhance log message (#383)

Add warning deploy_key on windows-latest
- Currently, the deploy_key option is not supported on the windows-latest.
- Related #87

Close #359
This commit is contained in:
Shohei Ueda
2020-07-09 05:15:51 +09:00
committed by GitHub
parent 31cdbe5222
commit 2e976845a6
4 changed files with 18 additions and 6 deletions

View File

@@ -44,6 +44,11 @@ Host github
await exec.exec('chmod', ['600', sshConfigPath]);
if (process.platform === 'win32') {
core.warning(`\
Currently, the deploy_key option is not supported on the windows-latest.
Watch https://github.com/peaceiris/actions-gh-pages/issues/87
`);
await cpSpawnSync('Start-Process', ['powershell.exe', '-Verb', 'runas']);
await cpSpawnSync('sh', ['-c', '\'eval "$(ssh-agent)"\''], {shell: true});
await exec.exec('sc', ['config', 'ssh-agent', 'start=auto']);
@@ -71,7 +76,10 @@ export function setGithubToken(
let isProhibitedBranch = false;
if (externalRepository) {
throw new Error('GITHUB_TOKEN does not support to push to an external repository');
throw new Error(`\
The generated GITHUB_TOKEN (github_token) does not support to push to an external repository.
Use deploy_key or personal_token.
`);
}
if (eventName === 'push') {