Skip to content

Commit 8991156

Browse files
committed
Deploy Production Code for Commit fd3cf89 🚀
1 parent fd3cf89 commit 8991156

File tree

6 files changed

+50
-13
lines changed

6 files changed

+50
-13
lines changed

lib/constants.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,16 @@ export declare enum Status {
7676
SKIPPED = "skipped",
7777
RUNNING = "running"
7878
}
79+
export declare enum OperatingSystems {
80+
LINUX = "Linux",
81+
WINDOWS = "Windows",
82+
MACOS = "macOS"
83+
}
84+
export declare const SupportedOperatingSystems: OperatingSystems[];
85+
export declare enum DefaultExcludedFiles {
86+
CNAME = "CNAME",
87+
NOJEKYLL = ".nojekyll",
88+
SSH = ".ssh",
89+
GIT = ".git",
90+
GITHUB = ".github"
91+
}

lib/constants.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
1919
return result;
2020
};
2121
Object.defineProperty(exports, "__esModule", { value: true });
22-
exports.Status = exports.action = exports.TestFlag = void 0;
22+
exports.DefaultExcludedFiles = exports.SupportedOperatingSystems = exports.OperatingSystems = exports.Status = exports.action = exports.TestFlag = void 0;
2323
const core_1 = require("@actions/core");
2424
const github = __importStar(require("@actions/github"));
2525
const util_1 = require("./util");
@@ -94,3 +94,20 @@ var Status;
9494
Status["SKIPPED"] = "skipped";
9595
Status["RUNNING"] = "running";
9696
})(Status = exports.Status || (exports.Status = {}));
97+
/* Platform codes. */
98+
var OperatingSystems;
99+
(function (OperatingSystems) {
100+
OperatingSystems["LINUX"] = "Linux";
101+
OperatingSystems["WINDOWS"] = "Windows";
102+
OperatingSystems["MACOS"] = "macOS";
103+
})(OperatingSystems = exports.OperatingSystems || (exports.OperatingSystems = {}));
104+
exports.SupportedOperatingSystems = [OperatingSystems.LINUX];
105+
/* Excluded files. */
106+
var DefaultExcludedFiles;
107+
(function (DefaultExcludedFiles) {
108+
DefaultExcludedFiles["CNAME"] = "CNAME";
109+
DefaultExcludedFiles["NOJEKYLL"] = ".nojekyll";
110+
DefaultExcludedFiles["SSH"] = ".ssh";
111+
DefaultExcludedFiles["GIT"] = ".git";
112+
DefaultExcludedFiles["GITHUB"] = ".github";
113+
})(DefaultExcludedFiles = exports.DefaultExcludedFiles || (exports.DefaultExcludedFiles = {}));

lib/git.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function init(action) {
2828
(0, core_1.info)('Configuring git…');
2929
yield (0, execute_1.execute)(`git config user.name "${action.name}"`, action.workspace, action.silent);
3030
yield (0, execute_1.execute)(`git config user.email "${action.email}"`, action.workspace, action.silent);
31+
yield (0, execute_1.execute)(`git config core.ignorecase false`, action.workspace, action.silent);
3132
try {
3233
if ((process.env.CI && !action.sshKey) || action.isTest) {
3334
/* Ensures that previously set Git configs do not interfere with the deployment.
@@ -96,12 +97,12 @@ function deploy(action) {
9697
yield (0, execute_1.execute)(`rsync -q -av --checksum --progress ${action.folderPath}/. ${action.targetFolder
9798
? `${temporaryDeploymentDirectory}/${action.targetFolder}`
9899
: temporaryDeploymentDirectory} ${action.clean
99-
? `--delete ${excludes} ${!fs_1.default.existsSync(`${action.folderPath}/CNAME`)
100-
? '--exclude CNAME'
101-
: ''} ${!fs_1.default.existsSync(`${action.folderPath}/.nojekyll`)
102-
? '--exclude .nojekyll'
100+
? `--delete ${excludes} ${!fs_1.default.existsSync(`${action.folderPath}/${constants_1.DefaultExcludedFiles.CNAME}`)
101+
? `--exclude ${constants_1.DefaultExcludedFiles.CNAME}`
102+
: ''} ${!fs_1.default.existsSync(`${action.folderPath}/${constants_1.DefaultExcludedFiles.NOJEKYLL}`)
103+
? `--exclude ${constants_1.DefaultExcludedFiles.NOJEKYLL}`
103104
: ''}`
104-
: ''} --exclude .ssh --exclude .git --exclude .github ${action.folderPath === action.workspace
105+
: ''} --exclude ${constants_1.DefaultExcludedFiles.SSH} --exclude ${constants_1.DefaultExcludedFiles.GIT} --exclude ${constants_1.DefaultExcludedFiles.GITHUB} ${action.folderPath === action.workspace
105106
? `--exclude ${temporaryDeploymentDirectory}`
106107
: ''}`, action.workspace, action.silent);
107108
if (action.singleCommit) {

lib/lib.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ function run(configuration) {
2525
(0, core_1.info)(`
2626
GitHub Pages Deploy Action 🚀
2727
28-
🚀 Getting Started Guide: https://github.com/marketplace/actions/deploy-to-github-pages
29-
❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
30-
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues
31-
28+
💖 Support: https://github.com/sponsors/JamesIves
3229
📣 Maintained by James Ives: https://jamesiv.es
33-
💖 Support: https://github.com/sponsors/JamesIves`);
30+
31+
🚀 Getting Started Guide: https://github.com/JamesIves/github-pages-deploy-action
32+
❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
33+
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues`);
3434
(0, core_1.info)('Checking configuration and starting deployment… 🚦');
3535
const settings = Object.assign({}, configuration);
3636
// Defines the repository/folder paths and token types.

lib/util.js

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports.stripProtocolFromUrl = exports.extractErrorMessage = exports.suppressSen
77
const core_1 = require("@actions/core");
88
const fs_1 = require("fs");
99
const path_1 = __importDefault(require("path"));
10+
const constants_1 = require("./constants");
1011
/* Replaces all instances of a match in a string. */
1112
const replaceAll = (input, find, replace) => input.split(find).join(replace);
1213
/* Utility function that checks to see if a value is undefined or not.
@@ -50,6 +51,9 @@ const checkParameters = (action) => {
5051
if (!(0, fs_1.existsSync)(action.folderPath)) {
5152
throw new Error(`The directory you're trying to deploy named ${action.folderPath} doesn't exist. Please double check the path and any prerequisite build scripts and try again. ❗`);
5253
}
54+
if (constants_1.SupportedOperatingSystems.includes(process.env.RUNNER_OS)) {
55+
(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+
}
5357
};
5458
exports.checkParameters = checkParameters;
5559
/* Suppresses sensitive information from being exposed in error messages. */

lib/worktree.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ function generateWorktree(action, worktreedir, branchExists) {
4444
// There's existing data on the branch to check out
4545
checkout.commitish = `origin/${action.branch}`;
4646
}
47-
if (!branchExists || action.singleCommit) {
48-
// Create a new history if we don't have the branch, or if we want to reset it
47+
if (!branchExists ||
48+
(action.singleCommit && action.branch !== process.env.GITHUB_REF_NAME)) {
49+
/* Create a new history if we don't have the branch, or if we want to reset it.
50+
If the ref name is the same as the branch name, do not attempt to create an orphan of it. */
4951
checkout.orphan = true;
5052
}
5153
yield (0, execute_1.execute)(checkout.toString(), `${action.workspace}/${worktreedir}`, action.silent);

0 commit comments

Comments
 (0)