Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d8382b381 | ||
|
|
8ccc2d9608 | ||
|
|
1b6740cb30 | ||
|
|
479c59e6d2 |
7
.github/workflows/test-action.yml
vendored
7
.github/workflows/test-action.yml
vendored
@@ -30,7 +30,6 @@ jobs:
|
|||||||
- 'macos-latest'
|
- 'macos-latest'
|
||||||
- 'windows-latest'
|
- 'windows-latest'
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Read .nvmrc
|
- name: Read .nvmrc
|
||||||
@@ -43,6 +42,12 @@ jobs:
|
|||||||
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
|
- name: Remove lint-staged husky
|
||||||
|
run: |
|
||||||
|
npm uninstall lint-staged husky
|
||||||
|
git checkout package-lock.json package.json
|
||||||
|
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
|
||||||
- name: Setup mdBook
|
- name: Setup mdBook
|
||||||
|
|||||||
@@ -2,6 +2,15 @@
|
|||||||
|
|
||||||
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.0.3-0](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.2...v3.0.3-0) (2020-02-06)
|
||||||
|
|
||||||
|
|
||||||
|
### fix
|
||||||
|
|
||||||
|
* Enable to create branch for first deployment (#92) ([1b6740c](https://github.com/peaceiris/actions-gh-pages/commit/1b6740cb30fc6a5a695a015144589862eb241b7d)), closes [#92](https://github.com/peaceiris/actions-gh-pages/issues/92)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [3.0.2](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.1...v3.0.2) (2020-02-05)
|
## [3.0.2](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.1...v3.0.2) (2020-02-05)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
44
lib/index.js
44
lib/index.js
@@ -8396,29 +8396,36 @@ function setRepo(inps, remoteURL) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
result.exitcode = yield exec.exec('git', [
|
try {
|
||||||
'clone',
|
result.exitcode = yield exec.exec('git', [
|
||||||
'--depth=1',
|
'clone',
|
||||||
'--single-branch',
|
'--depth=1',
|
||||||
'--branch',
|
'--single-branch',
|
||||||
inps.PublishBranch,
|
'--branch',
|
||||||
remoteURL,
|
inps.PublishBranch,
|
||||||
workDir
|
remoteURL,
|
||||||
], options);
|
workDir
|
||||||
process.chdir(workDir);
|
], options);
|
||||||
if (result.exitcode === 0) {
|
if (result.exitcode === 0) {
|
||||||
if (inps.KeepFiles) {
|
process.chdir(workDir);
|
||||||
core.info('[INFO] Keep existing files');
|
if (inps.KeepFiles) {
|
||||||
|
core.info('[INFO] Keep existing files');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yield exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
||||||
|
}
|
||||||
|
yield copyAssets(publishDir, workDir);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
yield exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
||||||
}
|
}
|
||||||
yield copyAssets(publishDir, workDir);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else {
|
catch (e) {
|
||||||
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
||||||
|
core.info(e);
|
||||||
yield createWorkDir(workDir);
|
yield createWorkDir(workDir);
|
||||||
|
process.chdir(workDir);
|
||||||
yield createBranchForce(inps.PublishBranch);
|
yield createBranchForce(inps.PublishBranch);
|
||||||
yield copyAssets(publishDir, workDir);
|
yield copyAssets(publishDir, workDir);
|
||||||
return;
|
return;
|
||||||
@@ -9589,9 +9596,6 @@ function setGithubToken(inps, publishRepo) {
|
|||||||
throw new Error(`You deploy from ${inps.PublishBranch} to ${inps.PublishBranch}`);
|
throw new Error(`You deploy from ${inps.PublishBranch} to ${inps.PublishBranch}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context.eventName === 'pull_request') {
|
|
||||||
throw new Error('This action does not support pull_request event now.');
|
|
||||||
}
|
|
||||||
const isPrivateRepository = (_b = payload.repository) === null || _b === void 0 ? void 0 : _b.private;
|
const isPrivateRepository = (_b = payload.repository) === null || _b === void 0 ? void 0 : _b.private;
|
||||||
if (inps.ExternalRepository) {
|
if (inps.ExternalRepository) {
|
||||||
throw new Error('GITHUB_TOKEN does not support to push to an external repository');
|
throw new Error('GITHUB_TOKEN does not support to push to an external repository');
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "actions-github-pages",
|
"name": "actions-github-pages",
|
||||||
"version": "3.0.2",
|
"version": "3.0.3-0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "actions-github-pages",
|
"name": "actions-github-pages",
|
||||||
"version": "3.0.2",
|
"version": "3.0.3-0",
|
||||||
"description": "GitHub Actions for GitHub Pages",
|
"description": "GitHub Actions for GitHub Pages",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -65,36 +65,41 @@ export async function setRepo(inps: Inputs, remoteURL: string): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
result.exitcode = await exec.exec(
|
|
||||||
'git',
|
|
||||||
[
|
|
||||||
'clone',
|
|
||||||
'--depth=1',
|
|
||||||
'--single-branch',
|
|
||||||
'--branch',
|
|
||||||
inps.PublishBranch,
|
|
||||||
remoteURL,
|
|
||||||
workDir
|
|
||||||
],
|
|
||||||
options
|
|
||||||
);
|
|
||||||
|
|
||||||
process.chdir(workDir);
|
try {
|
||||||
|
result.exitcode = await exec.exec(
|
||||||
|
'git',
|
||||||
|
[
|
||||||
|
'clone',
|
||||||
|
'--depth=1',
|
||||||
|
'--single-branch',
|
||||||
|
'--branch',
|
||||||
|
inps.PublishBranch,
|
||||||
|
remoteURL,
|
||||||
|
workDir
|
||||||
|
],
|
||||||
|
options
|
||||||
|
);
|
||||||
|
if (result.exitcode === 0) {
|
||||||
|
process.chdir(workDir);
|
||||||
|
if (inps.KeepFiles) {
|
||||||
|
core.info('[INFO] Keep existing files');
|
||||||
|
} else {
|
||||||
|
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
||||||
|
}
|
||||||
|
|
||||||
if (result.exitcode === 0) {
|
await copyAssets(publishDir, workDir);
|
||||||
if (inps.KeepFiles) {
|
return;
|
||||||
core.info('[INFO] Keep existing files');
|
|
||||||
} else {
|
} else {
|
||||||
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
await copyAssets(publishDir, workDir);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
core.info(
|
core.info(
|
||||||
`[INFO] first deployment, create new branch ${inps.PublishBranch}`
|
`[INFO] first deployment, create new branch ${inps.PublishBranch}`
|
||||||
);
|
);
|
||||||
|
core.info(e);
|
||||||
await createWorkDir(workDir);
|
await createWorkDir(workDir);
|
||||||
|
process.chdir(workDir);
|
||||||
await createBranchForce(inps.PublishBranch);
|
await createBranchForce(inps.PublishBranch);
|
||||||
await copyAssets(publishDir, workDir);
|
await copyAssets(publishDir, workDir);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -100,9 +100,6 @@ export async function setGithubToken(
|
|||||||
`You deploy from ${inps.PublishBranch} to ${inps.PublishBranch}`
|
`You deploy from ${inps.PublishBranch} to ${inps.PublishBranch}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (context.eventName === 'pull_request') {
|
|
||||||
// TODO: support pull_request event
|
|
||||||
throw new Error('This action does not support pull_request event now.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const isPrivateRepository = payload.repository?.private;
|
const isPrivateRepository = payload.repository?.private;
|
||||||
|
|||||||
Reference in New Issue
Block a user