Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3226514b95 | ||
|
|
4f4235c78c | ||
|
|
079d48367e | ||
|
|
4fb3d60161 | ||
|
|
0c8fc2d5e6 | ||
|
|
4bf31e4520 | ||
|
|
0794e07c99 | ||
|
|
2b5ce90dc9 | ||
|
|
681dcab3fd | ||
|
|
70c0076457 | ||
|
|
a49e738c32 | ||
|
|
5d053d30d0 | ||
|
|
4cf5105929 | ||
|
|
2392f69e4d | ||
|
|
fecb564860 | ||
|
|
7259f5ccc2 | ||
|
|
c8397307b4 | ||
|
|
7dd962e52e | ||
|
|
ded3953565 | ||
|
|
71958c534b | ||
|
|
eca3d9d25e | ||
|
|
24d40fe124 | ||
|
|
19b0b66a7c | ||
|
|
23abc3124a | ||
|
|
866d7e715c | ||
|
|
6f45501409 | ||
|
|
bf46251210 |
4
.github/workflows/dev-image.yml
vendored
4
.github/workflows/dev-image.yml
vendored
@@ -1,6 +1,9 @@
|
||||
name: 'Dev Image CI'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '11 11 * * *'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
@@ -36,6 +39,7 @@ jobs:
|
||||
- run: docker-compose pull --quiet
|
||||
if: github.event_name == 'pull_request'
|
||||
- run: make build
|
||||
- run: docker images
|
||||
- run: make ci
|
||||
- run: make all
|
||||
- run: docker-compose push
|
||||
|
||||
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
@@ -48,6 +48,15 @@ jobs:
|
||||
|
||||
- run: npm ci
|
||||
|
||||
- name: npm audit
|
||||
if: startsWith(matrix.os, 'ubuntu-18.04')
|
||||
run: |
|
||||
npm audit > ./audit.log || true
|
||||
if ! [ "$(cat ./audit.log | wc -l)" = 1 ]; then
|
||||
echo "::warning::$(cat ./audit.log)"
|
||||
fi
|
||||
rm ./audit.log
|
||||
|
||||
- name: Run prettier
|
||||
if: startsWith(matrix.os, 'ubuntu-18.04')
|
||||
run: npm run format:check
|
||||
|
||||
46
CHANGELOG.md
46
CHANGELOG.md
@@ -2,6 +2,52 @@
|
||||
|
||||
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.7.0-7](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-6...v3.7.0-7) (2020-08-02)
|
||||
|
||||
|
||||
### ci
|
||||
|
||||
* add env (#419) ([71958c5](https://github.com/peaceiris/actions-gh-pages/commit/71958c534b1f4dadbef055d8851541314574559b)), closes [#419](https://github.com/peaceiris/actions-gh-pages/issues/419)
|
||||
* Add npm audit (#426) ([a49e738](https://github.com/peaceiris/actions-gh-pages/commit/a49e738c320151f18296dbcda6a418408cd64ea3)), closes [#426](https://github.com/peaceiris/actions-gh-pages/issues/426)
|
||||
* add workflow_dispatch and schedule ([24d40fe](https://github.com/peaceiris/actions-gh-pages/commit/24d40fe124feecb6c5f4259a1906fcafd603b8f6))
|
||||
* change base image from Debian to Ubuntu 18.04 (#428) ([70c0076](https://github.com/peaceiris/actions-gh-pages/commit/70c0076457b26d38a26bacbac279b8bf35cc47c8)), closes [#428](https://github.com/peaceiris/actions-gh-pages/issues/428)
|
||||
* Clean up apt cache and junk (#425) ([5d053d3](https://github.com/peaceiris/actions-gh-pages/commit/5d053d30d0c607d63ce46c3d7ce321bfdb1c11c1)), closes [#425](https://github.com/peaceiris/actions-gh-pages/issues/425)
|
||||
* enhance version log (#429) ([681dcab](https://github.com/peaceiris/actions-gh-pages/commit/681dcab3fd25a0f24dc66bb2767c0e37934aad5c)), closes [#429](https://github.com/peaceiris/actions-gh-pages/issues/429)
|
||||
* reuse NODE_VERSION in nodesource URL (#430) ([2b5ce90](https://github.com/peaceiris/actions-gh-pages/commit/2b5ce90dc9ac2814d6e8ee5322d3e18b42ad008f)), closes [#430](https://github.com/peaceiris/actions-gh-pages/issues/430)
|
||||
* Set default branch to main (#424) ([4cf5105](https://github.com/peaceiris/actions-gh-pages/commit/4cf510592915a8c58f536094aa9b881196852ce1)), closes [#424](https://github.com/peaceiris/actions-gh-pages/issues/424)
|
||||
* set env CI to true (#418) ([eca3d9d](https://github.com/peaceiris/actions-gh-pages/commit/eca3d9d25efd39b60b2e32fe85e94b53951f9096)), closes [#418](https://github.com/peaceiris/actions-gh-pages/issues/418)
|
||||
|
||||
### deps
|
||||
|
||||
* Apply npm audit fix (#434) ([4bf31e4](https://github.com/peaceiris/actions-gh-pages/commit/4bf31e45208169b022dc9b870de61d6eea322d29)), closes [#434](https://github.com/peaceiris/actions-gh-pages/issues/434)
|
||||
* bump @types/node from 12.12.52 to 12.12.53 (#421) ([c839730](https://github.com/peaceiris/actions-gh-pages/commit/c8397307b446e9d81d20682060c40e8dd4de96b0)), closes [#421](https://github.com/peaceiris/actions-gh-pages/issues/421)
|
||||
* bump eslint-plugin-jest from 23.18.0 to 23.18.2 (#420) ([7259f5c](https://github.com/peaceiris/actions-gh-pages/commit/7259f5ccc2d61b325b9c8f33d570170a345d496b)), closes [#420](https://github.com/peaceiris/actions-gh-pages/issues/420)
|
||||
* bump eslint-plugin-jest from 23.18.2 to 23.19.0 (#423) ([2392f69](https://github.com/peaceiris/actions-gh-pages/commit/2392f69e4dd8264685215438922790389daedb24)), closes [#423](https://github.com/peaceiris/actions-gh-pages/issues/423)
|
||||
* bump eslint-plugin-jest from 23.19.0 to 23.20.0 (#432) ([0c8fc2d](https://github.com/peaceiris/actions-gh-pages/commit/0c8fc2d5e699acedef9512db7f3c240fa110285a)), closes [#432](https://github.com/peaceiris/actions-gh-pages/issues/432)
|
||||
* bump git from 2.27.0 to 2.28.0 (#422) ([fecb564](https://github.com/peaceiris/actions-gh-pages/commit/fecb5648609eee9e7add9fa2d5a9397abb3398db)), closes [#422](https://github.com/peaceiris/actions-gh-pages/issues/422)
|
||||
* bump jest-circus from 26.1.0 to 26.2.2 (#435) ([4fb3d60](https://github.com/peaceiris/actions-gh-pages/commit/4fb3d60161340ada324107b29fe7f4aa4a6487f0)), closes [#435](https://github.com/peaceiris/actions-gh-pages/issues/435)
|
||||
* bump node from 12.18.2 to 12.18.3 (#431) ([0794e07](https://github.com/peaceiris/actions-gh-pages/commit/0794e07c99f802bb0f1a4c00972e46b381a360ee)), closes [#431](https://github.com/peaceiris/actions-gh-pages/issues/431)
|
||||
|
||||
### docs
|
||||
|
||||
* Add exclude_assets section ([7dd962e](https://github.com/peaceiris/actions-gh-pages/commit/7dd962e52e7deb89dfa860da173ddbb96462d371))
|
||||
* bump hugo from 0.74.2 to 0.74.3 ([ded3953](https://github.com/peaceiris/actions-gh-pages/commit/ded3953565f3dde01b9678834705b16df9be1df6))
|
||||
|
||||
### feat
|
||||
|
||||
* Add .nojekyll file by default for all branches (#438) ([079d483](https://github.com/peaceiris/actions-gh-pages/commit/079d48367e5a8bc6448f5e9846666d27ea66e1e5)), closes [#438](https://github.com/peaceiris/actions-gh-pages/issues/438)
|
||||
|
||||
|
||||
|
||||
# [3.7.0-6](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-5...v3.7.0-6) (2020-07-25)
|
||||
|
||||
|
||||
### feat
|
||||
|
||||
* exclude_assets supports glob patterns (#417) ([6f45501](https://github.com/peaceiris/actions-gh-pages/commit/6f45501409dbe16857c00f6d40a51bea56254f2b)), closes [#417](https://github.com/peaceiris/actions-gh-pages/issues/417) [#163](https://github.com/peaceiris/actions-gh-pages/issues/163)
|
||||
|
||||
|
||||
|
||||
# [3.7.0-5](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-4...v3.7.0-5) (2020-07-25)
|
||||
|
||||
|
||||
|
||||
51
Dockerfile
51
Dockerfile
@@ -1,31 +1,46 @@
|
||||
ARG NODE_VERSION
|
||||
|
||||
FROM node:${NODE_VERSION}-buster-slim
|
||||
FROM ubuntu:18.04
|
||||
|
||||
SHELL ["/bin/bash", "-l", "-c"]
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends software-properties-common gnupg && \
|
||||
add-apt-repository ppa:git-core/ppa && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev autoconf \
|
||||
ca-certificates \
|
||||
git \
|
||||
curl \
|
||||
wget \
|
||||
ssh \
|
||||
vim && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
npm i -g npm
|
||||
apt-get autoclean && \
|
||||
apt-get clean && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /git
|
||||
ENV GIT_VERSION="2.27.0"
|
||||
RUN wget -q "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" && \
|
||||
tar -zxf "./v${GIT_VERSION}.tar.gz" && \
|
||||
rm "./v${GIT_VERSION}.tar.gz" && \
|
||||
cd "./git-${GIT_VERSION}" && \
|
||||
make configure && \
|
||||
./configure --prefix=/usr && \
|
||||
make all && \
|
||||
make install
|
||||
WORKDIR /node
|
||||
ARG NODE_VERSION
|
||||
RUN curl -o nodejs.deb "https://deb.nodesource.com/node_${NODE_VERSION%%.*}.x/pool/main/n/nodejs/nodejs_${NODE_VERSION}-1nodesource1_amd64.deb" && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends ./nodejs.deb && \
|
||||
npm i -g npm && \
|
||||
curl -sL https://deb.nodesource.com/test | bash - && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
rm -rf /node
|
||||
|
||||
WORKDIR /repo
|
||||
|
||||
ENV LANG="C.UTF-8"
|
||||
ENV ImageVersion="20200625.0"
|
||||
ENV GITHUB_API_URL="https://api.github.com"
|
||||
ENV RUNNER_TOOL_CACHE="/opt/hostedtoolcache"
|
||||
ENV GITHUB_REPOSITORY_OWNER="peaceiris"
|
||||
ENV GITHUB_ACTIONS="true"
|
||||
ENV CI="true"
|
||||
|
||||
RUN echo "node version: $(node -v)" && \
|
||||
echo "npm version: $(npm -v)" && \
|
||||
git --version && \
|
||||
git config --global init.defaultBranch main && \
|
||||
git config --global init.defaultBranch
|
||||
|
||||
CMD [ "bash" ]
|
||||
|
||||
42
README.md
42
README.md
@@ -76,6 +76,7 @@ All Actions runners: Linux (Ubuntu), macOS, and Windows are supported.
|
||||
- [⭐️ Target Branch `publish_branch`](#%EF%B8%8F-target-branch-publish_branch)
|
||||
- [⭐️ Source Directory `publish_dir`](#%EF%B8%8F-source-directory-publish_dir)
|
||||
- [⭐️ Deploy to Subdirectory `destination_dir`](#%EF%B8%8F-deploy-to-subdirectory-destination_dir)
|
||||
- [⭐️ Filter publishing assets `exclude_assets`](#%EF%B8%8F-filter-publishing-assets-exclude_assets)
|
||||
- [⭐️ Add CNAME file `cname`](#%EF%B8%8F-add-cname-file-cname)
|
||||
- [⭐️ Enable Built-in Jekyll `enable_jekyll`](#%EF%B8%8F-enable-built-in-jekyll-enable_jekyll)
|
||||
- [⭐️ Allow empty commits `allow_empty_commit`](#%EF%B8%8F-allow-empty-commits-allow_empty_commit)
|
||||
@@ -141,7 +142,7 @@ jobs:
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: '0.74.2'
|
||||
hugo-version: '0.74.3'
|
||||
|
||||
- name: Build
|
||||
run: hugo --minify
|
||||
@@ -275,12 +276,49 @@ A destination subdirectory on a publishing branch. The default is empty.
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3.7.0-0
|
||||
uses: peaceiris/actions-gh-pages@v3.7.0-6
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
destination_dir: subdir
|
||||
```
|
||||
|
||||
### ⭐️ Filter publishing assets `exclude_assets`
|
||||
|
||||
*This feature is on beta.*
|
||||
*Any feedback is welcome at [Issue #163](https://github.com/peaceiris/actions-gh-pages/issues/163)*
|
||||
|
||||
Set files or directories to exclude from publishing assets.
|
||||
The default is `.github`.
|
||||
Values should be split with a comma.
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3.7.0-6
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
exclude_assets: '.github,exclude-file1,exclude-file2'
|
||||
```
|
||||
|
||||
Set `exclude_assets` to empty for including the `.github` directory to deployment assets.
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3.7.0-6
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
exclude_assets: ''
|
||||
```
|
||||
|
||||
The `exclude_assets` option supports glob patterns.
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3.7.0-6
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
exclude_assets: '.github,exclude-file.txt,exclude-dir/**.txt'
|
||||
```
|
||||
|
||||
### ⭐️ Add CNAME file `cname`
|
||||
|
||||
To add `CNAME` file, we can set the `cname` option.
|
||||
|
||||
@@ -70,28 +70,14 @@ async function getWorkDir(): Promise<string> {
|
||||
}
|
||||
|
||||
describe('addNoJekyll()', () => {
|
||||
test('add .nojekyll gh-pages', async () => {
|
||||
test('add .nojekyll', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, false, 'gh-pages');
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(true);
|
||||
|
||||
fs.unlinkSync(filepath);
|
||||
});
|
||||
|
||||
test('add .nojekyll master', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, false, 'master');
|
||||
await addNoJekyll(workDir, false);
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(true);
|
||||
|
||||
@@ -106,57 +92,21 @@ describe('addNoJekyll()', () => {
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
fs.closeSync(fs.openSync(filepath, 'w'));
|
||||
|
||||
await addNoJekyll(workDir, false, 'master');
|
||||
await addNoJekyll(workDir, false);
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(true);
|
||||
|
||||
fs.unlinkSync(filepath);
|
||||
});
|
||||
|
||||
test('not add .nojekyll disable_nojekyll gh-pages', async () => {
|
||||
test('not add .nojekyll disable_nojekyll', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, true, 'gh-pages');
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(false);
|
||||
});
|
||||
|
||||
test('not add .nojekyll disable_nojekyll master', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, true, 'master');
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(false);
|
||||
});
|
||||
|
||||
test('not add .nojekyll other-branch', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, false, 'other-branch');
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(false);
|
||||
});
|
||||
|
||||
test('not add .nojekyll disable_nojekyll other-branch', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, true, 'other-branch');
|
||||
await addNoJekyll(workDir, true);
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(false);
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
631
package-lock.json
generated
631
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "actions-github-pages",
|
||||
"version": "3.7.0-5",
|
||||
"version": "3.7.0-7",
|
||||
"description": "GitHub Actions for GitHub Pages",
|
||||
"main": "lib/index.js",
|
||||
"engines": {
|
||||
@@ -57,6 +57,7 @@
|
||||
"@actions/core": "^1.2.4",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@actions/github": "^4.0.0",
|
||||
"@actions/glob": "^0.1.0",
|
||||
"@actions/io": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -68,11 +69,11 @@
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-jest": "^23.18.0",
|
||||
"eslint-plugin-jest": "^23.20.0",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"husky": "^4.2.5",
|
||||
"jest": "^25.5.4",
|
||||
"jest-circus": "^26.1.0",
|
||||
"jest-circus": "^26.2.2",
|
||||
"js-yaml": "^3.14.0",
|
||||
"lint-staged": "^10.2.11",
|
||||
"prettier": "2.0.5",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as io from '@actions/io';
|
||||
import * as glob from '@actions/glob';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import {Inputs, CmdResult} from './interfaces';
|
||||
@@ -12,28 +13,38 @@ export async function createBranchForce(branch: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
export async function deleteExcludedAssets(destDir: string, excludeAssets: string): Promise<void> {
|
||||
core.info(`[INFO] delete excluded assets`);
|
||||
const excludedAssetNames: Array<string> = excludeAssets.split(',');
|
||||
const excludedAssetPaths = ((): Array<string> => {
|
||||
const paths: Array<string> = [];
|
||||
for (const pattern of excludedAssetNames) {
|
||||
paths.push(path.join(destDir, pattern));
|
||||
}
|
||||
return paths;
|
||||
})();
|
||||
const globber = await glob.create(excludedAssetPaths.join('\n'));
|
||||
for await (const asset of globber.globGenerator()) {
|
||||
io.rmRF(asset);
|
||||
core.info(`[INFO] delete ${asset}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
export async function copyAssets(
|
||||
publishDir: string,
|
||||
destDir: string,
|
||||
excludeAssets: string
|
||||
): Promise<void> {
|
||||
core.info(`[INFO] prepare publishing assets`);
|
||||
const copyOpts = {recursive: true, force: true};
|
||||
const files = fs.readdirSync(publishDir);
|
||||
core.debug(`${files}`);
|
||||
for await (const file of files) {
|
||||
const isExcludeFile = ((): boolean => {
|
||||
const excludedAssetNames: Array<string> = excludeAssets.split(',');
|
||||
for (const excludedAssetName of excludedAssetNames) {
|
||||
if (file === excludedAssetName) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})();
|
||||
if (isExcludeFile || file === '.git') {
|
||||
if (file === '.git') {
|
||||
core.info(`[INFO] skip ${file}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const filePublishPath = path.join(publishDir, file);
|
||||
const fileDestPath = path.join(destDir, file);
|
||||
const destPath = path.dirname(fileDestPath);
|
||||
@@ -44,6 +55,8 @@ export async function copyAssets(
|
||||
core.info(`[INFO] copy ${file}`);
|
||||
}
|
||||
|
||||
await deleteExcludedAssets(destDir, excludeAssets);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ export async function run(): Promise<void> {
|
||||
const unixTime = date.getTime();
|
||||
const workDir = await getWorkDirName(`${unixTime}`);
|
||||
await setRepo(inps, remoteURL, workDir);
|
||||
await addNoJekyll(workDir, inps.DisableNoJekyll, inps.PublishBranch);
|
||||
await addNoJekyll(workDir, inps.DisableNoJekyll);
|
||||
await addCNAME(workDir, inps.CNAME);
|
||||
core.endGroup();
|
||||
|
||||
|
||||
18
src/utils.ts
18
src/utils.ts
@@ -29,22 +29,16 @@ export async function createDir(dirPath: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
export async function addNoJekyll(
|
||||
workDir: string,
|
||||
DisableNoJekyll: boolean,
|
||||
PublishBranch: string
|
||||
): Promise<void> {
|
||||
export async function addNoJekyll(workDir: string, DisableNoJekyll: boolean): Promise<void> {
|
||||
if (DisableNoJekyll) {
|
||||
return;
|
||||
}
|
||||
if (PublishBranch === 'master' || PublishBranch === 'gh-pages') {
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
if (fs.existsSync(filepath)) {
|
||||
return;
|
||||
}
|
||||
fs.closeSync(fs.openSync(filepath, 'w'));
|
||||
core.info(`[INFO] Created ${filepath}`);
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
if (fs.existsSync(filepath)) {
|
||||
return;
|
||||
}
|
||||
fs.closeSync(fs.openSync(filepath, 'w'));
|
||||
core.info(`[INFO] Created ${filepath}`);
|
||||
}
|
||||
|
||||
export async function addCNAME(workDir: string, content: string): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user