Skip to content

Commit

Permalink
Deploy Production Code for Commit 77237a3 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Nov 28, 2024
1 parent 77237a3 commit 289845b
Show file tree
Hide file tree
Showing 310 changed files with 9,524 additions and 3,391 deletions.
2 changes: 2 additions & 0 deletions lib/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface ActionInterface {
folderPath?: string;
/** Whether to force-push or attempt to merge existing changes. */
force?: boolean;
/** How many times to attempt to merge existing changes into the remote HEAD. */
attemptLimit?: number;
/** Determines test scenarios the action is running in. */
isTest: TestFlag;
/** The git config name. */
Expand Down
3 changes: 3 additions & 0 deletions lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ exports.action = {
force: !(0, util_1.isNullOrUndefined)((0, core_1.getInput)('force'))
? (0, core_1.getInput)('force').toLowerCase() === 'true'
: true,
attemptLimit: !(0, util_1.isNullOrUndefined)((0, core_1.getInput)('attempt-limit'))
? parseInt((0, core_1.getInput)('attempt-limit'), 10)
: 3,
clean: !(0, util_1.isNullOrUndefined)((0, core_1.getInput)('clean'))
? (0, core_1.getInput)('clean').toLowerCase() === 'true'
: false,
Expand Down
8 changes: 4 additions & 4 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function deploy(action) {
Pushes all of the build files into the deployment directory.
Allows the user to specify the root if '.' is provided.
rsync is used to prevent file duplication. */
yield (0, execute_1.execute)(`rsync -q -av --checksum --progress ${action.folderPath}/. ${action.targetFolder
yield (0, execute_1.execute)(`rsync -q -av --checksum --progress --mkpath ${action.folderPath}/. ${action.targetFolder
? `${temporaryDeploymentDirectory}/${action.targetFolder}`
: temporaryDeploymentDirectory} ${action.clean
? `--delete ${excludes} ${!fs_1.default.existsSync(`${action.folderPath}/${constants_1.DefaultExcludedFiles.CNAME}`)
Expand Down Expand Up @@ -159,15 +159,15 @@ function deploy(action) {
yield (0, execute_1.execute)(`git push --force ${action.repositoryPath} ${temporaryDeploymentBranch}:${action.branch}`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent);
}
else {
const ATTEMPT_LIMIT = 3;
const attemptLimit = action.attemptLimit || 3;
// Attempt to push our changes, but fetch + rebase if there were
// other changes added in the meantime
let attempt = 0;
// Keep track of whether the most recent attempt was rejected
let rejected = false;
do {
attempt++;
if (attempt > ATTEMPT_LIMIT)
if (attempt > attemptLimit)
throw new Error(`Attempt limit exceeded`);
// Handle rejection for the previous attempt first such that, on
// the final attempt, time is not wasted rebasing it when it will
Expand All @@ -178,7 +178,7 @@ function deploy(action) {
(0, core_1.info)(`Rebasing this deployment onto ${action.branch}…`);
yield (0, execute_1.execute)(`git rebase ${action.branch} ${temporaryDeploymentBranch}`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent);
}
(0, core_1.info)(`Pushing changes… (attempt ${attempt} of ${ATTEMPT_LIMIT})`);
(0, core_1.info)(`Pushing changes… (attempt ${attempt} of ${attemptLimit})`);
const pushResult = yield (0, execute_1.execute)(`git push --porcelain ${action.repositoryPath} ${temporaryDeploymentBranch}:${action.branch}`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent, true // Ignore non-zero exit status
);
rejected =
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 289845b

Please sign in to comment.