mirror of
https://github.com/status-im/actions-gh-pages.git
synced 2025-02-02 16:23:45 +00:00
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:
parent
31cdbe5222
commit
2e976845a6
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,3 +1,4 @@
|
||||
{
|
||||
"git.ignoreLimitWarning": true
|
||||
"git.ignoreLimitWarning": true,
|
||||
"deno.enable": false
|
||||
}
|
@ -63,7 +63,10 @@ describe('setGithubToken()', () => {
|
||||
'refs/heads/master',
|
||||
'push'
|
||||
);
|
||||
}).toThrowError('GITHUB_TOKEN does not support to push to an external repository');
|
||||
}).toThrowError(`\
|
||||
The generated GITHUB_TOKEN (github_token) does not support to push to an external repository.
|
||||
Use deploy_key or personal_token.
|
||||
`);
|
||||
});
|
||||
|
||||
test('return remote url with GITHUB_TOKEN pull_request', () => {
|
||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -6994,9 +6994,9 @@
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
||||
"version": "4.17.19",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
|
||||
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
|
||||
"dev": true
|
||||
},
|
||||
"lodash._reinterpolate": {
|
||||
|
@ -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') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user