Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba0b7df03e | ||
|
|
87a781f6ce | ||
|
|
6fa13fefb3 | ||
|
|
efb69e1873 | ||
|
|
9d932c08b7 | ||
|
|
53c9fb0da1 | ||
|
|
d6bd6182f2 | ||
|
|
01fdaf2f02 | ||
|
|
75c03d0413 |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -2,6 +2,28 @@
|
|||||||
|
|
||||||
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.
|
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.6](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.5...v3.5.6) (2020-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### fix
|
||||||
|
|
||||||
|
* skip on fork (#159) ([6fa13fe](https://github.com/peaceiris/actions-gh-pages/commit/6fa13fefb393227eec5c9710d92e8bffa917546a)), closes [#159](https://github.com/peaceiris/actions-gh-pages/issues/159)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [3.5.5](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4...v3.5.5) (2020-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### chore
|
||||||
|
|
||||||
|
* Add new task all ([01fdaf2](https://github.com/peaceiris/actions-gh-pages/commit/01fdaf2f0274401d2403c809b20c37fb7a8535a6))
|
||||||
|
|
||||||
|
### fix
|
||||||
|
|
||||||
|
* skip on fork if pull_request (#158) ([d6bd618](https://github.com/peaceiris/actions-gh-pages/commit/d6bd6182f264ce695613180743d42e377570bbf4)), closes [#158](https://github.com/peaceiris/actions-gh-pages/issues/158) [#157](https://github.com/peaceiris/actions-gh-pages/issues/157)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [3.5.4](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.3...v3.5.4) (2020-03-16)
|
## [3.5.4](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.3...v3.5.4) (2020-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -21,3 +21,7 @@ test:
|
|||||||
.PHONY: commit
|
.PHONY: commit
|
||||||
commit:
|
commit:
|
||||||
$(DOCKER_RUN) git commit -m "$(msg)"
|
$(DOCKER_RUN) git commit -m "$(msg)"
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all:
|
||||||
|
$(DOCKER_RUN) npm run all
|
||||||
|
|||||||
13
lib/index.js
13
lib/index.js
@@ -1766,11 +1766,14 @@ function run() {
|
|||||||
try {
|
try {
|
||||||
const inps = get_inputs_1.getInputs();
|
const inps = get_inputs_1.getInputs();
|
||||||
get_inputs_1.showInputs(inps);
|
get_inputs_1.showInputs(inps);
|
||||||
const isForkRepository = github_1.context.payload.repository.fork;
|
const eventName = github_1.context.eventName;
|
||||||
const isSkipOnFork = yield utils_1.skipOnFork(isForkRepository, inps.GithubToken, inps.DeployKey, inps.PersonalToken);
|
if (eventName === 'pull_request' || eventName === 'push') {
|
||||||
if (isSkipOnFork) {
|
const isForkRepository = github_1.context.payload.repository.fork;
|
||||||
core.warning('This action runs on a fork and not found auth token, Skip deployment');
|
const isSkipOnFork = yield utils_1.skipOnFork(isForkRepository, inps.GithubToken, inps.DeployKey, inps.PersonalToken);
|
||||||
return;
|
if (isSkipOnFork) {
|
||||||
|
core.warning('This action runs on a fork and not found auth token, Skip deployment');
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const remoteURL = yield set_tokens_1.setTokens(inps);
|
const remoteURL = yield set_tokens_1.setTokens(inps);
|
||||||
core.debug(`[INFO] remoteURL: ${remoteURL}`);
|
core.debug(`[INFO] remoteURL: ${remoteURL}`);
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "actions-github-pages",
|
"name": "actions-github-pages",
|
||||||
"version": "3.5.4",
|
"version": "3.5.6",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "actions-github-pages",
|
"name": "actions-github-pages",
|
||||||
"version": "3.5.4",
|
"version": "3.5.6",
|
||||||
"description": "GitHub Actions for GitHub Pages",
|
"description": "GitHub Actions for GitHub Pages",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
"npm": ">=6.14.2"
|
"npm": ">=6.14.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"all": "npm run format && npm run lint && npm test",
|
||||||
"lint": "eslint ./{src,__tests__}/**/*.ts",
|
"lint": "eslint ./{src,__tests__}/**/*.ts",
|
||||||
"lint:fix": "eslint --fix ./{src,__tests__}/**/*.ts",
|
"lint:fix": "eslint --fix ./{src,__tests__}/**/*.ts",
|
||||||
"test": "jest --coverage --verbose --detectOpenHandles",
|
"test": "jest --coverage --verbose --detectOpenHandles",
|
||||||
|
|||||||
27
src/main.ts
27
src/main.ts
@@ -12,19 +12,22 @@ export async function run(): Promise<void> {
|
|||||||
const inps: Inputs = getInputs();
|
const inps: Inputs = getInputs();
|
||||||
showInputs(inps);
|
showInputs(inps);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
const eventName = context.eventName;
|
||||||
const isForkRepository = (context.payload as any).repository.fork;
|
if (eventName === 'pull_request' || eventName === 'push') {
|
||||||
const isSkipOnFork = await skipOnFork(
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
isForkRepository,
|
const isForkRepository = (context.payload as any).repository.fork;
|
||||||
inps.GithubToken,
|
const isSkipOnFork = await skipOnFork(
|
||||||
inps.DeployKey,
|
isForkRepository,
|
||||||
inps.PersonalToken
|
inps.GithubToken,
|
||||||
);
|
inps.DeployKey,
|
||||||
if (isSkipOnFork) {
|
inps.PersonalToken
|
||||||
core.warning(
|
|
||||||
'This action runs on a fork and not found auth token, Skip deployment'
|
|
||||||
);
|
);
|
||||||
return;
|
if (isSkipOnFork) {
|
||||||
|
core.warning(
|
||||||
|
'This action runs on a fork and not found auth token, Skip deployment'
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const remoteURL = await setTokens(inps);
|
const remoteURL = await setTokens(inps);
|
||||||
|
|||||||
Reference in New Issue
Block a user