Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
476e697393 | ||
|
|
07d4ccdcfe | ||
|
|
44bdada02c | ||
|
|
4377a42d7a | ||
|
|
ee834289d5 | ||
|
|
a9077f3fa3 | ||
|
|
72f58a06cf | ||
|
|
a8a9c90a27 |
18
CHANGELOG.md
18
CHANGELOG.md
@@ -2,6 +2,24 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [3.5.4-6](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4-5...v3.5.4-6) (2020-03-15)
|
||||
|
||||
|
||||
### fix
|
||||
|
||||
* skip logic ([44bdada](https://github.com/peaceiris/actions-gh-pages/commit/44bdada02c71f646d23ffefe1ea07d16386dbf83))
|
||||
|
||||
|
||||
|
||||
## [3.5.4-5](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4-4...v3.5.4-5) (2020-03-14)
|
||||
|
||||
|
||||
### fix
|
||||
|
||||
* property access ([72f58a0](https://github.com/peaceiris/actions-gh-pages/commit/72f58a06cf5db88d3eb982f57de8dbc266e39232))
|
||||
|
||||
|
||||
|
||||
## [3.5.4-4](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4-3...v3.5.4-4) (2020-03-14)
|
||||
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ describe('skipOnFork()', () => {
|
||||
expect(test).toBeFalsy();
|
||||
});
|
||||
|
||||
test('return true on fork with empty deploy_key or personal_token', async () => {
|
||||
test('return true on fork with no tokens', async () => {
|
||||
const test = await skipOnFork(true, '', '', '');
|
||||
expect(test).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -1766,9 +1766,10 @@ function run() {
|
||||
try {
|
||||
const inps = get_inputs_1.getInputs();
|
||||
get_inputs_1.showInputs(inps);
|
||||
const isForkRepository = github_1.context.payload.repository.fork === 'true';
|
||||
const isForkRepository = github_1.context.payload.repository.fork;
|
||||
const isSkipOnFork = yield utils_1.skipOnFork(isForkRepository, inps.GithubToken, inps.DeployKey, inps.PersonalToken);
|
||||
if (isSkipOnFork) {
|
||||
core.warning('Action runs on fork and deploy_key or personal_token is empty, Skip deployment');
|
||||
return;
|
||||
}
|
||||
const remoteURL = yield set_tokens_1.setTokens(inps);
|
||||
@@ -2271,11 +2272,7 @@ exports.addCNAME = addCNAME;
|
||||
function skipOnFork(isForkRepository, githubToken, deployKey, personalToken) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (isForkRepository) {
|
||||
if (githubToken) {
|
||||
return false;
|
||||
}
|
||||
if (deployKey === '' && personalToken === '') {
|
||||
core.warning('Action runs on fork and deploy_key or personal_token is empty');
|
||||
if (githubToken === '' && deployKey === '' && personalToken === '') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "actions-github-pages",
|
||||
"version": "3.5.4-4",
|
||||
"version": "3.5.4-6",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "actions-github-pages",
|
||||
"version": "3.5.4-4",
|
||||
"version": "3.5.4-6",
|
||||
"description": "GitHub Actions for GitHub Pages",
|
||||
"main": "lib/index.js",
|
||||
"engines": {
|
||||
|
||||
@@ -12,9 +12,8 @@ export async function run(): Promise<void> {
|
||||
const inps: Inputs = getInputs();
|
||||
showInputs(inps);
|
||||
|
||||
const isForkRepository =
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(context.payload as any).repository.fork === 'true';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isForkRepository = (context.payload as any).repository.fork;
|
||||
const isSkipOnFork = await skipOnFork(
|
||||
isForkRepository,
|
||||
inps.GithubToken,
|
||||
@@ -22,6 +21,9 @@ export async function run(): Promise<void> {
|
||||
inps.PersonalToken
|
||||
);
|
||||
if (isSkipOnFork) {
|
||||
core.warning(
|
||||
'Action runs on fork and deploy_key or personal_token is empty, Skip deployment'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,14 +70,7 @@ export async function skipOnFork(
|
||||
personalToken: string
|
||||
): Promise<boolean> {
|
||||
if (isForkRepository) {
|
||||
if (githubToken) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (deployKey === '' && personalToken === '') {
|
||||
core.warning(
|
||||
'Action runs on fork and deploy_key or personal_token is empty'
|
||||
);
|
||||
if (githubToken === '' && deployKey === '' && personalToken === '') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user