Socket
Socket
Sign inDemoInstall

@jamesives/github-pages-deploy-action

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jamesives/github-pages-deploy-action - npm Package Compare versions

Comparing version 4.1.9 to 4.2.0

8

__tests__/git.test.ts

@@ -58,3 +58,3 @@ // Initial env variable setup for tests.

await init(action)
expect(execute).toBeCalledTimes(5)
expect(execute).toBeCalledTimes(6)
})

@@ -106,3 +106,3 @@

await init(action)
expect(execute).toBeCalledTimes(5)
expect(execute).toBeCalledTimes(6)
})

@@ -129,3 +129,3 @@

await init(action)
expect(execute).toBeCalledTimes(4)
expect(execute).toBeCalledTimes(5)

@@ -151,3 +151,3 @@ process.env.CI = undefined

await init(action)
expect(execute).toBeCalledTimes(5)
expect(execute).toBeCalledTimes(6)
})

@@ -154,0 +154,0 @@ })

@@ -5,2 +5,3 @@ // Initial env variable setup for tests.

process.env['INPUT_DEBUG'] = 'debug'
process.env['GITHUB_REF_NAME'] = 'test'

@@ -53,3 +54,3 @@ import '../src/main'

await run(action)
expect(execute).toBeCalledTimes(15)
expect(execute).toBeCalledTimes(16)
expect(rmRF).toBeCalledTimes(1)

@@ -74,3 +75,3 @@ expect(exportVariable).toBeCalledTimes(1)

await run(action)
expect(execute).toBeCalledTimes(18)
expect(execute).toBeCalledTimes(19)
expect(rmRF).toBeCalledTimes(1)

@@ -77,0 +78,0 @@ expect(exportVariable).toBeCalledTimes(1)

// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/typescript-node
{
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "12"
}
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": ["dbaeumer.vscode-eslint"],
"remoteUser": "node"
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "14"
}
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"dbaeumer.vscode-eslint"
],
"remoteUser": "node"
}

@@ -20,6 +20,10 @@ ---

<!-- Please provide your deployment logs and a link or sample to/of your workflow. If the error message isn't revealing the problem please set ACTIONS_STEP_DEBUG to true in your repository's secrets menu and run the workflow again. -->
<!-- Please provide your deployment logs. If the error message isn't revealing the problem please set ACTIONS_STEP_DEBUG to true in your repository's secrets menu and run the workflow again. -->
## Workflow
<!-- Please provide a link or snippet of your workflow yml file. -->
## Additional Comments
<!--Add any other context about the problem here. -->

@@ -79,1 +79,14 @@ export declare enum TestFlag {

}
export declare enum OperatingSystems {
LINUX = "Linux",
WINDOWS = "Windows",
MACOS = "macOS"
}
export declare const SupportedOperatingSystems: OperatingSystems[];
export declare enum DefaultExcludedFiles {
CNAME = "CNAME",
NOJEKYLL = ".nojekyll",
SSH = ".ssh",
GIT = ".git",
GITHUB = ".github"
}

@@ -22,3 +22,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Status = exports.action = exports.TestFlag = void 0;
exports.DefaultExcludedFiles = exports.SupportedOperatingSystems = exports.OperatingSystems = exports.Status = exports.action = exports.TestFlag = void 0;
const core_1 = require("@actions/core");

@@ -98,1 +98,18 @@ const github = __importStar(require("@actions/github"));

})(Status = exports.Status || (exports.Status = {}));
/* Platform codes. */
var OperatingSystems;
(function (OperatingSystems) {
OperatingSystems["LINUX"] = "Linux";
OperatingSystems["WINDOWS"] = "Windows";
OperatingSystems["MACOS"] = "macOS";
})(OperatingSystems = exports.OperatingSystems || (exports.OperatingSystems = {}));
exports.SupportedOperatingSystems = [OperatingSystems.LINUX];
/* Excluded files. */
var DefaultExcludedFiles;
(function (DefaultExcludedFiles) {
DefaultExcludedFiles["CNAME"] = "CNAME";
DefaultExcludedFiles["NOJEKYLL"] = ".nojekyll";
DefaultExcludedFiles["SSH"] = ".ssh";
DefaultExcludedFiles["GIT"] = ".git";
DefaultExcludedFiles["GITHUB"] = ".github";
})(DefaultExcludedFiles = exports.DefaultExcludedFiles || (exports.DefaultExcludedFiles = {}));

@@ -31,2 +31,3 @@ "use strict";

yield (0, execute_1.execute)(`git config user.email "${action.email}"`, action.workspace, action.silent);
yield (0, execute_1.execute)(`git config core.ignorecase false`, action.workspace, action.silent);
try {

@@ -100,8 +101,8 @@ if ((process.env.CI && !action.sshKey) || action.isTest) {

: temporaryDeploymentDirectory} ${action.clean
? `--delete ${excludes} ${!fs_1.default.existsSync(`${action.folderPath}/CNAME`)
? '--exclude CNAME'
: ''} ${!fs_1.default.existsSync(`${action.folderPath}/.nojekyll`)
? '--exclude .nojekyll'
? `--delete ${excludes} ${!fs_1.default.existsSync(`${action.folderPath}/${constants_1.DefaultExcludedFiles.CNAME}`)
? `--exclude ${constants_1.DefaultExcludedFiles.CNAME}`
: ''} ${!fs_1.default.existsSync(`${action.folderPath}/${constants_1.DefaultExcludedFiles.NOJEKYLL}`)
? `--exclude ${constants_1.DefaultExcludedFiles.NOJEKYLL}`
: ''}`
: ''} --exclude .ssh --exclude .git --exclude .github ${action.folderPath === action.workspace
: ''} --exclude ${constants_1.DefaultExcludedFiles.SSH} --exclude ${constants_1.DefaultExcludedFiles.GIT} --exclude ${constants_1.DefaultExcludedFiles.GITHUB} ${action.folderPath === action.workspace
? `--exclude ${temporaryDeploymentDirectory}`

@@ -108,0 +109,0 @@ : ''}`, action.workspace, action.silent);

@@ -28,8 +28,8 @@ "use strict";

🚀 Getting Started Guide: https://github.com/marketplace/actions/deploy-to-github-pages
💖 Support: https://github.com/sponsors/JamesIves
📣 Maintained by James Ives: https://jamesiv.es
🚀 Getting Started Guide: https://github.com/JamesIves/github-pages-deploy-action
❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues
📣 Maintained by James Ives: https://jamesiv.es
💖 Support: https://github.com/sponsors/JamesIves`);
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues`);
(0, core_1.info)('Checking configuration and starting deployment… 🚦');

@@ -36,0 +36,0 @@ const settings = Object.assign({}, configuration);

@@ -10,2 +10,3 @@ "use strict";

const path_1 = __importDefault(require("path"));
const constants_1 = require("./constants");
/* Replaces all instances of a match in a string. */

@@ -54,2 +55,5 @@ const replaceAll = (input, find, replace) => input.split(find).join(replace);

}
if (constants_1.SupportedOperatingSystems.includes(process.env.RUNNER_OS)) {
(0, core_1.info)(`The operating system you're using is not supported and results may be varied. Please refer to the documentation for more details. ❗`);
}
};

@@ -56,0 +60,0 @@ exports.checkParameters = checkParameters;

@@ -47,4 +47,6 @@ "use strict";

}
if (!branchExists || action.singleCommit) {
// Create a new history if we don't have the branch, or if we want to reset it
if (!branchExists ||
(action.singleCommit && action.branch !== process.env.GITHUB_REF_NAME)) {
/* Create a new history if we don't have the branch, or if we want to reset it.
If the ref name is the same as the branch name, do not attempt to create an orphan of it. */
checkout.orphan = true;

@@ -51,0 +53,0 @@ }

@@ -5,3 +5,3 @@ {

"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)",
"version": "4.1.9",
"version": "4.2.0",
"license": "MIT",

@@ -8,0 +8,0 @@ "main": "lib/lib.js",

@@ -55,3 +55,3 @@ <p align="center">

- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.5.1

@@ -64,3 +64,3 @@ - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.9
uses: JamesIves/github-pages-deploy-action@4.2.0
with:

@@ -80,3 +80,3 @@ branch: gh-pages # The branch the action should deploy to.

It's recommended that you use [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates) to keep your workflow up-to-date and [secure](https://github.com/features/security). 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).
It's recommended that you use [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically) to keep your workflow up-to-date and [secure](https://github.com/features/security). 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).

@@ -143,3 +143,3 @@ #### Install as a Node Module 📦

| `git-config-name` | Allows you to customize the name that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the name in the GitHub context, followed by the name of the action. | `with` | **No** |
| `git-config-email` | Allows you to customize the email that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the email in the GitHub context, followed by a generic noreply GitHub email. You can include `<>` for the value if you wish to omit this field altogether and push the commits without an email. | `with` | **No** |
| `git-config-email` | Allows you to customize the email that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the email in the GitHub context, followed by a generic noreply GitHub email. You can include `<>` for the value if you wish to omit this field altogether and push the commits without an email. | `with` | **No** |
| `repository-name` | Allows you to specify a different repository path so long as you have permissions to push to it. This should be formatted like so: `JamesIves/github-pages-deploy-action`. You'll need to use a PAT in the `token` input for this configuration option to work properly. | `with` | **No** |

@@ -185,3 +185,3 @@ | `target-folder` | If you'd like to push the contents of the deployment folder into a specific directory on the deployment branch you can specify it here. | `with` | **No** |

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.9
uses: JamesIves/github-pages-deploy-action@4.2.0
with:

@@ -207,3 +207,3 @@ branch: gh-pages

- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.5.1

@@ -216,3 +216,3 @@ - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.9
uses: JamesIves/github-pages-deploy-action@4.2.0
with:

@@ -258,3 +258,3 @@ branch: gh-pages

- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.5.1

@@ -277,3 +277,3 @@ - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.

- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.5.1

@@ -286,3 +286,3 @@ - name: Download Artifacts 🔻 # The built project is downloaded into the 'site' folder.

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.9
uses: JamesIves/github-pages-deploy-action@4.2.0
with:

@@ -308,3 +308,3 @@ branch: gh-pages

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.9
uses: JamesIves/github-pages-deploy-action@4.2.0
```

@@ -332,3 +332,3 @@

- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.5.1

@@ -341,3 +341,3 @@ - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.9
uses: JamesIves/github-pages-deploy-action@4.2.0
with:

@@ -344,0 +344,0 @@ branch: gh-pages

@@ -10,3 +10,3 @@ # Security Policy

| 4.0.x | :white_check_mark: |
| < 4.0.0 | :x: |
| < 4.0.0 | :x: |

@@ -13,0 +13,0 @@ ## Reporting a Vulnerability

@@ -151,1 +151,19 @@ import {getInput} from '@actions/core'

}
/* Platform codes. */
export enum OperatingSystems {
LINUX = 'Linux',
WINDOWS = 'Windows',
MACOS = 'macOS'
}
export const SupportedOperatingSystems = [OperatingSystems.LINUX]
/* Excluded files. */
export enum DefaultExcludedFiles {
CNAME = 'CNAME',
NOJEKYLL = '.nojekyll',
SSH = '.ssh',
GIT = '.git',
GITHUB = '.github'
}
import {info} from '@actions/core'
import {mkdirP, rmRF} from '@actions/io'
import fs from 'fs'
import {ActionInterface, Status, TestFlag} from './constants'
import {
ActionInterface,
DefaultExcludedFiles,
Status,
TestFlag
} from './constants'
import {execute} from './execute'

@@ -24,2 +29,3 @@ import {generateWorktree} from './worktree'

)
await execute(

@@ -31,2 +37,8 @@ `git config user.email "${action.email}"`,

await execute(
`git config core.ignorecase false`,
action.workspace,
action.silent
)
try {

@@ -134,12 +146,18 @@ if ((process.env.CI && !action.sshKey) || action.isTest) {

? `--delete ${excludes} ${
!fs.existsSync(`${action.folderPath}/CNAME`)
? '--exclude CNAME'
!fs.existsSync(
`${action.folderPath}/${DefaultExcludedFiles.CNAME}`
)
? `--exclude ${DefaultExcludedFiles.CNAME}`
: ''
} ${
!fs.existsSync(`${action.folderPath}/.nojekyll`)
? '--exclude .nojekyll'
!fs.existsSync(
`${action.folderPath}/${DefaultExcludedFiles.NOJEKYLL}`
)
? `--exclude ${DefaultExcludedFiles.NOJEKYLL}`
: ''
}`
: ''
} --exclude .ssh --exclude .git --exclude .github ${
} --exclude ${DefaultExcludedFiles.SSH} --exclude ${
DefaultExcludedFiles.GIT
} --exclude ${DefaultExcludedFiles.GITHUB} ${
action.folderPath === action.workspace

@@ -146,0 +164,0 @@ ? `--exclude ${temporaryDeploymentDirectory}`

@@ -26,9 +26,9 @@ import {exportVariable, info, setFailed, setOutput} from '@actions/core'

🚀 Getting Started Guide: https://github.com/marketplace/actions/deploy-to-github-pages
💖 Support: https://github.com/sponsors/JamesIves
📣 Maintained by James Ives: https://jamesiv.es
🚀 Getting Started Guide: https://github.com/JamesIves/github-pages-deploy-action
❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues`)
📣 Maintained by James Ives: https://jamesiv.es
💖 Support: https://github.com/sponsors/JamesIves`)
info('Checking configuration and starting deployment… 🚦')

@@ -35,0 +35,0 @@

@@ -1,5 +0,10 @@

import {isDebug} from '@actions/core'
import {isDebug, info} from '@actions/core'
import {existsSync} from 'fs'
import path from 'path'
import {ActionInterface, RequiredActionParameters} from './constants'
import {
ActionInterface,
OperatingSystems,
RequiredActionParameters,
SupportedOperatingSystems
} from './constants'

@@ -69,2 +74,12 @@ /* Replaces all instances of a match in a string. */

}
if (
SupportedOperatingSystems.includes(
process.env.RUNNER_OS as OperatingSystems
)
) {
info(
`The operating system you're using is not supported and results may be varied. Please refer to the documentation for more details. ❗`
)
}
}

@@ -71,0 +86,0 @@

@@ -46,3 +46,5 @@ import {info} from '@actions/core'

)
const checkout = new GitCheckout(action.branch)
if (branchExists) {

@@ -52,6 +54,12 @@ // There's existing data on the branch to check out

}
if (!branchExists || action.singleCommit) {
// Create a new history if we don't have the branch, or if we want to reset it
if (
!branchExists ||
(action.singleCommit && action.branch !== process.env.GITHUB_REF_NAME)
) {
/* Create a new history if we don't have the branch, or if we want to reset it.
If the ref name is the same as the branch name, do not attempt to create an orphan of it. */
checkout.orphan = true
}
await execute(

@@ -62,4 +70,6 @@ checkout.toString(),

)
if (!branchExists) {
info(`Created the ${action.branch} branch… 🔧`)
// Our index is in HEAD state, reset

@@ -71,2 +81,3 @@ await execute(

)
if (!action.singleCommit) {

@@ -73,0 +84,0 @@ // New history isn't singleCommit, create empty initial commit

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc