Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd8c6b06eb | ||
|
|
ae7759a398 | ||
|
|
9b7ce2a171 | ||
|
|
983978086a | ||
|
|
7859c9b784 | ||
|
|
fd54e565f4 | ||
|
|
2c6daf7153 | ||
|
|
8206a5f364 | ||
|
|
cba22ba760 | ||
|
|
87c1b90704 | ||
|
|
411de78882 | ||
|
|
9209134025 | ||
|
|
2ae4e44c71 | ||
|
|
20411ac459 | ||
|
|
76446f8a5e | ||
|
|
8fc4f66b0e | ||
|
|
6932db2544 | ||
|
|
16b8f766df | ||
|
|
ffa3183092 | ||
|
|
afad39bf81 | ||
|
|
29aefb7700 | ||
|
|
0725e5789b | ||
|
|
3b42e19751 | ||
|
|
fe2eb19a96 | ||
|
|
25b90d1c7e | ||
|
|
416f539fb4 | ||
|
|
32c9288f55 | ||
|
|
da1b4ad62b | ||
|
|
b992418825 | ||
|
|
6c8719badb | ||
|
|
47d01f16d3 | ||
|
|
5e5dc6d02e | ||
|
|
7af79a873e | ||
|
|
dd7d778958 | ||
|
|
e3aa46d23b | ||
|
|
2306f39f4e | ||
|
|
64b46b4226 | ||
|
|
1a7c3d89ae | ||
|
|
679dbf02f6 | ||
|
|
25b12e2a24 | ||
|
|
2f463a5ad5 | ||
|
|
f94667a25c | ||
|
|
fdfb4d88a0 | ||
|
|
072d16c439 | ||
|
|
7166f2caa4 | ||
|
|
e3b45f2700 | ||
|
|
1808965241 | ||
|
|
a5f971f112 | ||
|
|
087a759f90 | ||
|
|
9af6a68dde | ||
|
|
811c45844b |
23
.github/dependabot.yml
vendored
23
.github/dependabot.yml
vendored
@@ -1,23 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: '11:00'
|
||||
timezone: Japan
|
||||
labels:
|
||||
- dependencies
|
||||
allow:
|
||||
- dependency-type: "production"
|
||||
commit-message:
|
||||
prefix: deps
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "CI/CD"
|
||||
commit-message:
|
||||
prefix: ci
|
||||
2
.github/labeler.yml
vendored
2
.github/labeler.yml
vendored
@@ -1,4 +1,4 @@
|
||||
CI/CD:
|
||||
cicd:
|
||||
- .github/workflows/*
|
||||
|
||||
dependencies:
|
||||
|
||||
2
.github/workflows/dependency-review.yml
vendored
2
.github/workflows/dependency-review.yml
vendored
@@ -13,4 +13,4 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/dependency-review-action@v2
|
||||
- uses: actions/dependency-review-action@v3
|
||||
|
||||
2
.github/workflows/labeler.yml
vendored
2
.github/workflows/labeler.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
permissions: {}
|
||||
steps:
|
||||
# https://github.com/peaceiris/actions-github-app-token
|
||||
- uses: peaceiris/actions-github-app-token@v1.1.4
|
||||
- uses: peaceiris/actions-github-app-token@v1.1.5
|
||||
id: app
|
||||
with:
|
||||
app_id: ${{ secrets.GH_APP_ID }}
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -11,6 +11,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# https://github.com/peaceiris/workflows/blob/main/create-release-npm/action.yml
|
||||
- uses: peaceiris/workflows/create-release-npm@v0.17.1
|
||||
- uses: peaceiris/workflows/create-release-npm@v0.19.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
16
.github/workflows/test.yml
vendored
16
.github/workflows/test.yml
vendored
@@ -29,19 +29,9 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
run: echo "${GITHUB_CONTEXT}"
|
||||
|
||||
- name: Read .nvmrc
|
||||
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
|
||||
id: nvm
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
- uses: peaceiris/workflows/setup-node@v0.19.1
|
||||
with:
|
||||
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Dump version
|
||||
run: |
|
||||
@@ -89,7 +79,7 @@ jobs:
|
||||
|
||||
- name: Setup mdBook
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
uses: peaceiris/actions-mdbook@v1.1.14
|
||||
uses: peaceiris/actions-mdbook@v1.2.0
|
||||
with:
|
||||
mdbook-version: '0.4.5'
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
npm ci
|
||||
npm install
|
||||
git remote prune origin
|
||||
|
||||
50
CHANGELOG.md
50
CHANGELOG.md
@@ -2,6 +2,56 @@
|
||||
|
||||
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.9.2](https://github.com/peaceiris/actions-gh-pages/compare/v3.9.1...v3.9.2) (2023-01-17)
|
||||
|
||||
|
||||
### chore
|
||||
|
||||
* rename cicd ([32c9288](https://github.com/peaceiris/actions-gh-pages/commit/32c9288f553bbcbf66869cf553c82754431faf03))
|
||||
* replace npm ci with install ([9839780](https://github.com/peaceiris/actions-gh-pages/commit/983978086a87d25a1ff678aa1ef4c2acc413784a))
|
||||
|
||||
### ci
|
||||
|
||||
* add github-actions npm ([5e5dc6d](https://github.com/peaceiris/actions-gh-pages/commit/5e5dc6d02eeb18001e0a7af6d6fcbabd4fd9e2b7))
|
||||
* enable automerge ([dd7d778](https://github.com/peaceiris/actions-gh-pages/commit/dd7d77895818fd15ebecf20b6bf76028d377e1b6))
|
||||
* remove dependabot ([7af79a8](https://github.com/peaceiris/actions-gh-pages/commit/7af79a873e9c2b6c37690db94012342fdb90914a))
|
||||
* remove enabledManagers ([cba22ba](https://github.com/peaceiris/actions-gh-pages/commit/cba22ba760f1c7e62c9ae43167ea68ca9de56506))
|
||||
* use peaceiris/workflows/setup-node 0.19.1 (#818) ([416f539](https://github.com/peaceiris/actions-gh-pages/commit/416f539fb4263ec46f9bbee251e87cfeae9f85ff)), closes [#818](https://github.com/peaceiris/actions-gh-pages/issues/818)
|
||||
|
||||
### deps
|
||||
|
||||
* apply npm audit fix (#809) ([e3aa46d](https://github.com/peaceiris/actions-gh-pages/commit/e3aa46d23bbf7f669a6d92c15dda089b2edf4959)), closes [#809](https://github.com/peaceiris/actions-gh-pages/issues/809)
|
||||
|
||||
|
||||
|
||||
## [3.9.1](https://github.com/peaceiris/actions-gh-pages/compare/v3.9.0...v3.9.1) (2023-01-05)
|
||||
|
||||
|
||||
### chore
|
||||
|
||||
* change cicd label name ([1808965](https://github.com/peaceiris/actions-gh-pages/commit/180896524151a5634ff5815a72c59467fc27c874))
|
||||
|
||||
### ci
|
||||
|
||||
* add Renovate config (#802) ([072d16c](https://github.com/peaceiris/actions-gh-pages/commit/072d16c439270cd3a36c3e0977ccbe10f2b2bc55)), closes [#802](https://github.com/peaceiris/actions-gh-pages/issues/802)
|
||||
* bump actions/dependency-review-action from 2 to 3 (#799) ([e3b45f2](https://github.com/peaceiris/actions-gh-pages/commit/e3b45f27007dc55bcdd52f01e38af6f61576ec7f)), closes [#799](https://github.com/peaceiris/actions-gh-pages/issues/799)
|
||||
* bump peaceiris/actions-github-app-token from 1.1.4 to 1.1.5 (#798) ([a5f971f](https://github.com/peaceiris/actions-gh-pages/commit/a5f971f112fd50b6dd28469f23be2618b1ea87e7)), closes [#798](https://github.com/peaceiris/actions-gh-pages/issues/798)
|
||||
* bump peaceiris/actions-mdbook from 1.1.14 to 1.2.0 (#793) ([9af6a68](https://github.com/peaceiris/actions-gh-pages/commit/9af6a68dde7720af8fd55364c2c637ca5922a879)), closes [#793](https://github.com/peaceiris/actions-gh-pages/issues/793)
|
||||
* bump peaceiris/workflows from 0.17.1 to 0.17.2 (#794) ([087a759](https://github.com/peaceiris/actions-gh-pages/commit/087a759f907a127fdee23c8994321ff96f7d9430)), closes [#794](https://github.com/peaceiris/actions-gh-pages/issues/794)
|
||||
* bump peaceiris/workflows from 0.17.2 to 0.18.1 (#806) ([f94667a](https://github.com/peaceiris/actions-gh-pages/commit/f94667a25cd2716a8a046111457e4b17c8c28407)), closes [#806](https://github.com/peaceiris/actions-gh-pages/issues/806)
|
||||
|
||||
### deps
|
||||
|
||||
* bump @actions/github from 5.0.1 to 5.1.1 (#785) ([679dbf0](https://github.com/peaceiris/actions-gh-pages/commit/679dbf02f69022f8c402975fdefe41ddb31516cd)), closes [#785](https://github.com/peaceiris/actions-gh-pages/issues/785)
|
||||
* bump @actions/glob from 0.2.1 to 0.3.0 (#735) ([25b12e2](https://github.com/peaceiris/actions-gh-pages/commit/25b12e2a24490dbc96aa0d5201e94b1b4cca7fb0)), closes [#735](https://github.com/peaceiris/actions-gh-pages/issues/735)
|
||||
* bump minimatch from 3.0.4 to 3.1.2 (#807) ([2f463a5](https://github.com/peaceiris/actions-gh-pages/commit/2f463a5ad59a66a5a83e0f072f6d556898e6cc9e)), closes [#807](https://github.com/peaceiris/actions-gh-pages/issues/807)
|
||||
|
||||
### docs
|
||||
|
||||
* replace deprecated set-output (#800) ([7166f2c](https://github.com/peaceiris/actions-gh-pages/commit/7166f2caa423717780ff24040f0163cbe511c18c)), closes [#800](https://github.com/peaceiris/actions-gh-pages/issues/800)
|
||||
|
||||
|
||||
|
||||
# [3.9.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.8.0...v3.9.0) (2022-10-23)
|
||||
|
||||
|
||||
|
||||
@@ -976,7 +976,7 @@ jobs:
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: echo "::set-output name=dir::$(pip cache dir)"
|
||||
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v3
|
||||
|
||||
@@ -184,6 +184,6 @@ describe('getInputs()', () => {
|
||||
|
||||
expect(() => {
|
||||
getInputs();
|
||||
}).toThrowError('Use either of enable_jekyll or disable_nojekyll');
|
||||
}).toThrow('Use either of enable_jekyll or disable_nojekyll');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -148,7 +148,7 @@ describe('setRepo()', () => {
|
||||
const date = new Date();
|
||||
const unixTime = date.getTime();
|
||||
const workDir = await getWorkDirName(`${unixTime}`);
|
||||
await expect(setRepo(inps, remoteURL, workDir)).rejects.toThrowError(
|
||||
await expect(setRepo(inps, remoteURL, workDir)).rejects.toThrow(
|
||||
'destination_dir should be a relative path'
|
||||
);
|
||||
});
|
||||
@@ -241,17 +241,13 @@ describe('setCommitAuthor()', () => {
|
||||
test('throw error user_email is undefined', async () => {
|
||||
const userName = 'custom-octocat';
|
||||
const userEmail = '';
|
||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrowError(
|
||||
'user_email is undefined'
|
||||
);
|
||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrow('user_email is undefined');
|
||||
});
|
||||
|
||||
test('throw error user_name is undefined', async () => {
|
||||
const userName = '';
|
||||
const userEmail = 'custom-octocat@github.com';
|
||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrowError(
|
||||
'user_name is undefined'
|
||||
);
|
||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrow('user_name is undefined');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -70,13 +70,13 @@ describe('setGithubToken()', () => {
|
||||
'refs/heads/gh-pages-base',
|
||||
'push'
|
||||
);
|
||||
}).toThrowError('You deploy from gh-pages-base to gh-pages-base');
|
||||
}).toThrow('You deploy from gh-pages-base to gh-pages-base');
|
||||
});
|
||||
|
||||
test('throw error master to master', () => {
|
||||
expect(() => {
|
||||
setGithubToken('GITHUB_TOKEN', 'owner/repo', 'master', '', 'refs/heads/master', 'push');
|
||||
}).toThrowError('You deploy from master to master');
|
||||
}).toThrow('You deploy from master to master');
|
||||
});
|
||||
|
||||
test('throw error external repository with GITHUB_TOKEN', () => {
|
||||
@@ -89,7 +89,7 @@ describe('setGithubToken()', () => {
|
||||
'refs/heads/master',
|
||||
'push'
|
||||
);
|
||||
}).toThrowError(`\
|
||||
}).toThrow(`\
|
||||
The generated GITHUB_TOKEN (github_token) does not support to push to an external repository.
|
||||
Use deploy_key or personal_token.
|
||||
`);
|
||||
|
||||
File diff suppressed because one or more lines are too long
10786
package-lock.json
generated
10786
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
46
package.json
46
package.json
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "actions-github-pages",
|
||||
"version": "3.9.0",
|
||||
"version": "3.9.2",
|
||||
"description": "GitHub Actions for GitHub Pages",
|
||||
"main": "lib/index.js",
|
||||
"engines": {
|
||||
"node": ">=16.18.0",
|
||||
"npm": ">=8.19.0"
|
||||
"node": ">=v16.19.0",
|
||||
"npm": ">=9.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "npx husky install",
|
||||
@@ -49,31 +49,31 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.0.1",
|
||||
"@actions/glob": "^0.2.1",
|
||||
"@actions/github": "^5.1.1",
|
||||
"@actions/glob": "^0.3.0",
|
||||
"@actions/io": "^1.1.2",
|
||||
"@types/shelljs": "^0.8.11",
|
||||
"shelljs": "^0.8.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/js-yaml": "^4.0.0",
|
||||
"@types/node": "~12",
|
||||
"@typescript-eslint/eslint-plugin": "^4.16.1",
|
||||
"@typescript-eslint/parser": "^4.16.1",
|
||||
"@vercel/ncc": "^0.27.0",
|
||||
"eslint": "^7.21.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-plugin-jest": "^24.1.5",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"husky": "^5.1.3",
|
||||
"jest": "^26.6.3",
|
||||
"jest-circus": "^26.6.3",
|
||||
"js-yaml": "^4.0.0",
|
||||
"lint-staged": "^10.5.4",
|
||||
"prettier": "2.2.1",
|
||||
"@types/jest": "^29.2.5",
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"@types/node": "~16",
|
||||
"@typescript-eslint/eslint-plugin": "^5.48.2",
|
||||
"@typescript-eslint/parser": "^5.48.2",
|
||||
"@vercel/ncc": "^0.36.0",
|
||||
"eslint": "^8.32.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"husky": "^8.0.3",
|
||||
"jest": "^29.3.1",
|
||||
"jest-circus": "^29.3.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lint-staged": "^13.1.0",
|
||||
"prettier": "2.8.3",
|
||||
"standard-version": "^9.1.1",
|
||||
"ts-jest": "^26.5.3",
|
||||
"typescript": "^4.2.3"
|
||||
"ts-jest": "^29.0.5",
|
||||
"typescript": "^4.9.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ else
|
||||
git pull origin --tags
|
||||
fi
|
||||
|
||||
npm ci
|
||||
npm install
|
||||
|
||||
mkdir ./lib
|
||||
npm run build
|
||||
|
||||
13
renovate.json
Normal file
13
renovate.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"local>peaceiris/renovate-config"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"automerge": true,
|
||||
"matchUpdateTypes": ["minor", "patch"],
|
||||
"automergeStrategy": "squash"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -127,15 +127,19 @@ export async function setRepo(inps: Inputs, remoteURL: string, workDir: string):
|
||||
} else {
|
||||
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
||||
}
|
||||
} catch (e) {
|
||||
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
||||
core.info(`[INFO] ${e.message}`);
|
||||
await createDir(destDir);
|
||||
core.info(`[INFO] chdir ${workDir}`);
|
||||
process.chdir(workDir);
|
||||
await createBranchForce(inps.PublishBranch);
|
||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||
return;
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
||||
core.info(`[INFO] ${error.message}`);
|
||||
await createDir(destDir);
|
||||
core.info(`[INFO] chdir ${workDir}`);
|
||||
process.chdir(workDir);
|
||||
await createBranchForce(inps.PublishBranch);
|
||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||
return;
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,9 +205,13 @@ export async function commit(allowEmptyCommit: boolean, msg: string): Promise<vo
|
||||
} else {
|
||||
await exec.exec('git', ['commit', '-m', `${msg}`]);
|
||||
}
|
||||
} catch (e) {
|
||||
core.info('[INFO] skip commit');
|
||||
core.debug(`[INFO] skip commit ${e.message}`);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
core.info('[INFO] skip commit');
|
||||
core.debug(`[INFO] skip commit ${error.message}`);
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,11 @@ import * as main from './main';
|
||||
(async (): Promise<void> => {
|
||||
try {
|
||||
await main.run();
|
||||
} catch (e) {
|
||||
core.setFailed(`Action failed with "${e.message}"`);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
core.setFailed(`Action failed with "${error.message}"`);
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
16
src/main.ts
16
src/main.ts
@@ -57,8 +57,12 @@ export async function run(): Promise<void> {
|
||||
core.startGroup('Setup Git config');
|
||||
try {
|
||||
await exec.exec('git', ['remote', 'rm', 'origin']);
|
||||
} catch (e) {
|
||||
core.info(`[INFO] ${e.message}`);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
core.info(`[INFO] ${error.message}`);
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
await exec.exec('git', ['remote', 'add', 'origin', remoteURL]);
|
||||
await exec.exec('git', ['add', '--all']);
|
||||
@@ -86,7 +90,11 @@ export async function run(): Promise<void> {
|
||||
core.info('[INFO] Action successfully completed');
|
||||
|
||||
return;
|
||||
} catch (e) {
|
||||
throw new Error(e.message);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,11 @@ export async function setTokens(inps: Inputs): Promise<string> {
|
||||
} else {
|
||||
throw new Error('not found deploy key or tokens');
|
||||
}
|
||||
} catch (e) {
|
||||
throw new Error(e.message);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user