Skip to content

Commit 8ac8403

Browse files
committed
Deploy Production Code for Commit 0d36216 🚀
1 parent 0d36216 commit 8ac8403

20 files changed

+672
-269
lines changed

lib/constants.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface ActionInterface {
1111
/** If your project generates hashed files on build you can use this option to automatically delete them from the deployment branch with each deploy. This option can be toggled on by setting it to true. */
1212
clean?: boolean | null;
1313
/** If you need to use CLEAN but you'd like to preserve certain files or folders you can use this option. */
14-
cleanExclude?: string | string[];
14+
cleanExclude?: string[];
1515
/** If you need to customize the commit message for an integration you can do so. */
1616
commitMessage?: string;
1717
/** The git config email. */

lib/constants.js

+24-22
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,47 @@ var TestFlag;
3333
})(TestFlag = exports.TestFlag || (exports.TestFlag = {}));
3434
/* Required action data that gets initialized when running within the GitHub Actions environment. */
3535
exports.action = {
36-
folder: core_1.getInput('FOLDER'),
37-
branch: core_1.getInput('BRANCH'),
38-
commitMessage: core_1.getInput('COMMIT_MESSAGE'),
39-
dryRun: !util_1.isNullOrUndefined(core_1.getInput('DRY_RUN'))
40-
? core_1.getInput('DRY_RUN').toLowerCase() === 'true'
36+
folder: core_1.getInput('folder'),
37+
branch: core_1.getInput('branch'),
38+
commitMessage: core_1.getInput('commit-message'),
39+
dryRun: !util_1.isNullOrUndefined(core_1.getInput('dry-run'))
40+
? core_1.getInput('dry-run').toLowerCase() === 'true'
4141
: false,
42-
clean: !util_1.isNullOrUndefined(core_1.getInput('CLEAN'))
43-
? core_1.getInput('CLEAN').toLowerCase() === 'true'
42+
clean: !util_1.isNullOrUndefined(core_1.getInput('clean'))
43+
? core_1.getInput('clean').toLowerCase() === 'true'
4444
: false,
45-
cleanExclude: core_1.getInput('CLEAN_EXCLUDE'),
45+
cleanExclude: (core_1.getInput('clean-exclude') || '')
46+
.split('\n')
47+
.filter(l => l !== ''),
4648
isTest: TestFlag.NONE,
47-
email: !util_1.isNullOrUndefined(core_1.getInput('GIT_CONFIG_EMAIL'))
48-
? core_1.getInput('GIT_CONFIG_EMAIL')
49+
email: !util_1.isNullOrUndefined(core_1.getInput('git-config-email'))
50+
? core_1.getInput('git-config-email')
4951
: pusher && pusher.email
5052
? pusher.email
5153
: `${process.env.GITHUB_ACTOR || 'github-pages-deploy-action'}@users.noreply.github.com`,
52-
name: !util_1.isNullOrUndefined(core_1.getInput('GIT_CONFIG_NAME'))
53-
? core_1.getInput('GIT_CONFIG_NAME')
54+
name: !util_1.isNullOrUndefined(core_1.getInput('git-config-name'))
55+
? core_1.getInput('git-config-name')
5456
: pusher && pusher.name
5557
? pusher.name
5658
: process.env.GITHUB_ACTOR
5759
? process.env.GITHUB_ACTOR
5860
: 'GitHub Pages Deploy Action',
59-
repositoryName: !util_1.isNullOrUndefined(core_1.getInput('REPOSITORY_NAME'))
60-
? core_1.getInput('REPOSITORY_NAME')
61+
repositoryName: !util_1.isNullOrUndefined(core_1.getInput('repository-name'))
62+
? core_1.getInput('repository-name')
6163
: repository && repository.full_name
6264
? repository.full_name
6365
: process.env.GITHUB_REPOSITORY,
64-
token: core_1.getInput('TOKEN'),
65-
singleCommit: !util_1.isNullOrUndefined(core_1.getInput('SINGLE_COMMIT'))
66-
? core_1.getInput('SINGLE_COMMIT').toLowerCase() === 'true'
66+
token: core_1.getInput('token'),
67+
singleCommit: !util_1.isNullOrUndefined(core_1.getInput('single-commit'))
68+
? core_1.getInput('single-commit').toLowerCase() === 'true'
6769
: false,
68-
silent: !util_1.isNullOrUndefined(core_1.getInput('SILENT'))
69-
? core_1.getInput('SILENT').toLowerCase() === 'true'
70+
silent: !util_1.isNullOrUndefined(core_1.getInput('silent'))
71+
? core_1.getInput('silent').toLowerCase() === 'true'
7072
: false,
71-
ssh: !util_1.isNullOrUndefined(core_1.getInput('SSH'))
72-
? core_1.getInput('SSH').toLowerCase() === 'true'
73+
ssh: !util_1.isNullOrUndefined(core_1.getInput('ssh'))
74+
? core_1.getInput('ssh').toLowerCase() === 'true'
7375
: false,
74-
targetFolder: core_1.getInput('TARGET_FOLDER'),
76+
targetFolder: core_1.getInput('target-folder'),
7577
workspace: process.env.GITHUB_WORKSPACE || ''
7678
};
7779
/** Status codes for the action. */

lib/git.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,13 @@ function deploy(action) {
5050
: `Deploying to ${action.branch}${process.env.GITHUB_SHA ? ` from @ ${process.env.GITHUB_SHA}` : ''} 🚀`;
5151
// Checks to see if the remote exists prior to deploying.
5252
const branchExists = action.isTest & constants_1.TestFlag.HAS_REMOTE_BRANCH ||
53-
(yield execute_1.execute(`git ls-remote --heads ${action.repositoryPath} ${action.branch} | wc -l`, action.workspace, action.silent));
53+
(yield execute_1.execute(`git ls-remote --heads ${action.repositoryPath} ${action.branch}`, action.workspace, action.silent));
5454
yield worktree_1.generateWorktree(action, temporaryDeploymentDirectory, branchExists);
5555
// Ensures that items that need to be excluded from the clean job get parsed.
5656
let excludes = '';
5757
if (action.clean && action.cleanExclude) {
58-
try {
59-
const excludedItems = typeof action.cleanExclude === 'string'
60-
? JSON.parse(action.cleanExclude)
61-
: action.cleanExclude;
62-
for (const item of excludedItems) {
63-
excludes += `--exclude ${item} `;
64-
}
65-
}
66-
catch (_a) {
67-
core_1.info('There was an error parsing your CLEAN_EXCLUDE items. Please refer to the README for more details. ❌');
58+
for (const item of action.cleanExclude) {
59+
excludes += `--exclude ${item} `;
6860
}
6961
}
7062
if (action.targetFolder) {

lib/lib.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ function run(configuration) {
5151
: status === constants_1.Status.SUCCESS
5252
? 'Completed deployment successfully! ✅'
5353
: 'There is nothing to commit. Exiting early… 📭'}`);
54-
core_1.exportVariable('DEPLOYMENT_STATUS', status);
54+
core_1.exportVariable('deployment_status', status);
55+
core_1.setOutput('deployment-status', status);
5556
}
5657
});
5758
}

node_modules/@types/node/README.md

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@types/node/assert.d.ts

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@types/node/child_process.d.ts

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)