diff --git a/.vscode/settings.json b/.vscode/settings.json index 3b66410..57a849f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "git.ignoreLimitWarning": true + "git.ignoreLimitWarning": true, + "deno.enable": false } \ No newline at end of file diff --git a/__tests__/set-tokens.test.ts b/__tests__/set-tokens.test.ts index 1a7a743..d6c373c 100644 --- a/__tests__/set-tokens.test.ts +++ b/__tests__/set-tokens.test.ts @@ -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', () => { diff --git a/package-lock.json b/package-lock.json index 8fea418..8fa008e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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": { diff --git a/src/set-tokens.ts b/src/set-tokens.ts index 97a36dd..ab1e462 100644 --- a/src/set-tokens.ts +++ b/src/set-tokens.ts @@ -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') {