@jamesives/github-pages-deploy-action
Advanced tools
Comparing version 3.5.7 to 3.5.8
@@ -9,2 +9,3 @@ // Initial env variable setup for tests. | ||
import {deploy, generateBranch, init, switchToBaseBranch} from '../src/git' | ||
import fs from 'fs'; | ||
@@ -366,2 +367,26 @@ const originalAction = JSON.stringify(action) | ||
it('should not ignore CNAME or nojekyll if they exist in the deployment folder', async () => { | ||
Object.assign(action, { | ||
silent: false, | ||
folder: 'assets', | ||
branch: 'branch', | ||
gitHubToken: '123', | ||
pusher: { | ||
name: 'asd', | ||
email: 'as@cat' | ||
}, | ||
clean: true, | ||
}) | ||
const response = await deploy(action) | ||
fs.createWriteStream("assets/.nojekyll"); | ||
fs.createWriteStream("assets/CNAME"); | ||
// Includes the call to generateBranch | ||
expect(execute).toBeCalledTimes(12) | ||
expect(rmRF).toBeCalledTimes(1) | ||
expect(response).toBe(Status.SUCCESS) | ||
}) | ||
it('should execute commands with single commit toggled', async () => { | ||
@@ -386,2 +411,3 @@ Object.assign(action, { | ||
}) | ||
@@ -388,0 +414,0 @@ it('should execute commands with clean options, ommits sha commit message', async () => { |
@@ -11,2 +11,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,2 +19,3 @@ exports.deploy = exports.generateBranch = exports.switchToBaseBranch = exports.init = void 0; | ||
const io_1 = require("@actions/io"); | ||
const fs_1 = __importDefault(require("fs")); | ||
const constants_1 = require("./constants"); | ||
@@ -125,3 +129,5 @@ const execute_1 = require("./execute"); | ||
: temporaryDeploymentDirectory} ${action.clean | ||
? `--delete ${excludes} --exclude CNAME --exclude .nojekyll` | ||
? `--delete ${excludes} ${!fs_1.default.existsSync(`${action.folder}/CNAME`) ? '--exclude CNAME' : ''} ${!fs_1.default.existsSync(`${action.folder}/.nojekyll`) | ||
? '--exclude .nojekyll' | ||
: ''}` | ||
: ''} --exclude .ssh --exclude .git --exclude .github ${action.folder === action.root | ||
@@ -128,0 +134,0 @@ ? `--exclude ${temporaryDeploymentDirectory}` |
@@ -5,3 +5,3 @@ { | ||
"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)", | ||
"version": "3.5.7", | ||
"version": "3.5.8", | ||
"license": "MIT", | ||
@@ -43,7 +43,7 @@ "main": "lib/lib.js", | ||
"devDependencies": { | ||
"@types/jest": "26.0.3", | ||
"@types/node": "14.0.14", | ||
"eslint": "7.3.1", | ||
"@types/jest": "26.0.4", | ||
"@types/node": "14.0.23", | ||
"eslint": "7.4.0", | ||
"eslint-plugin-github": "3.4.1", | ||
"eslint-plugin-jest": "23.17.1", | ||
"eslint-plugin-jest": "23.18.0", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
@@ -50,0 +50,0 @@ "jest": "25.5.4", |
@@ -55,3 +55,3 @@ <p align="center"> | ||
- name: Checkout ๐๏ธ | ||
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | ||
uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | ||
with: | ||
@@ -66,3 +66,3 @@ persist-credentials: false | ||
- name: Deploy ๐ | ||
uses: JamesIves/github-pages-deploy-action@releases/v3 | ||
uses: JamesIves/github-pages-deploy-action@3.5.7 | ||
with: | ||
@@ -83,2 +83,4 @@ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
It's recommended that you use [Dependabot](https://dependabot.com/github-actions/) to keep your workflow up-to-date. You can find the latest tagged version on the [GitHub Marketplace](https://github.com/marketplace/actions/deploy-to-github-pages) or on the [releases page](https://github.com/JamesIves/github-pages-deploy-action/releases). | ||
#### Install as a Node Module ๐ฆ | ||
@@ -321,4 +323,6 @@ | ||
If you're using a custom domain and require a `CNAME` file, or if you require the use of a `.nojekyll` file, you can safely commit these files directly into deployment branch without them being overridden after each deployment. | ||
If you're using a custom domain and require a `CNAME` file, or if you require the use of a `.nojekyll` file, you can safely commit these files directly into deployment branch without them being overridden after each deployment. Additionally you can include these files in your deployment folder to update them. | ||
If you wish to remove these files you must go into the deployment branch directly to remove them. This is to prevent accidental changes in your deployment script from creating breaking changes. | ||
--- | ||
@@ -325,0 +329,0 @@ |
import {info} from '@actions/core' | ||
import {rmRF, mkdirP} from '@actions/io' | ||
import {mkdirP, rmRF} from '@actions/io' | ||
import fs from 'fs' | ||
import {ActionInterface, Status} from './constants' | ||
@@ -196,3 +197,9 @@ import {execute} from './execute' | ||
action.clean | ||
? `--delete ${excludes} --exclude CNAME --exclude .nojekyll` | ||
? `--delete ${excludes} ${ | ||
!fs.existsSync(`${action.folder}/CNAME`) ? '--exclude CNAME' : '' | ||
} ${ | ||
!fs.existsSync(`${action.folder}/.nojekyll`) | ||
? '--exclude .nojekyll' | ||
: '' | ||
}` | ||
: '' | ||
@@ -199,0 +206,0 @@ } --exclude .ssh --exclude .git --exclude .github ${ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1695218
1892
329
12