function generateBranch() {
    return __awaiter(this, void 0, void 0, function* () {
        try {
            console.log(`Creating ${constants_1.action.branch} branch... 🔧`);
            yield switchToBaseBranch();
            yield execute_1.execute(`git checkout --orphan ${constants_1.action.branch}`, constants_1.workspace);
            yield execute_1.execute(`git reset --hard`, constants_1.workspace);
            yield execute_1.execute(`git commit --allow-empty -m "Initial ${constants_1.action.branch} commit."`, constants_1.workspace);
            yield execute_1.execute(`git push ${constants_1.repositoryPath} ${constants_1.action.branch}`, constants_1.workspace);
            yield execute_1.execute(`git fetch`, constants_1.workspace);
        }
        catch (error) {
            core.setFailed(`There was an error creating the deployment branch: ${error} ❌`);
        }
        finally {
            return Promise.resolve("Deployment branch creation step complete... ✅");
        }
    });
}
/** Generates the branch if it doesn't exist on the remote.
 * @returns {Promise}
 */
Generates the branch if it doesn't exist on the remote.
@returns {Promise}
Generates the branch if it doesn ' t exist on the remote . @returns { Promise }
function generateBranch() {
    return __awaiter(this, void 0, void 0, function* () {
        try {
            console.log(`Creating ${constants_1.action.branch} branch... 🔧`);
            yield switchToBaseBranch();
            yield execute_1.execute(`git checkout --orphan ${constants_1.action.branch}`, constants_1.workspace);
            yield execute_1.execute(`git reset --hard`, constants_1.workspace);
            yield execute_1.execute(`git commit --allow-empty -m "Initial ${constants_1.action.branch} commit."`, constants_1.workspace);
            yield execute_1.execute(`git push ${constants_1.repositoryPath} ${constants_1.action.branch}`, constants_1.workspace);
            yield execute_1.execute(`git fetch`, constants_1.workspace);
        }
        catch (error) {
            core.setFailed(`There was an error creating the deployment branch: ${error} ❌`);
        }
        finally {
            return Promise.resolve("Deployment branch creation step complete... ✅");
        }
    });
}
function generateBranch ( ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { try { console . log ( ` ${ constants_1 . action . branch } yield switchToBaseBranch ( ) ; yield execute_1 . execute ( ` ${ constants_1 . action . branch } ` , constants_1 . workspace ) ; yield execute_1 . execute ( ` ` , constants_1 . workspace ) ; yield execute_1 . execute ( ` ${ constants_1 . action . branch } ` , constants_1 . workspace ) ; yield execute_1 . execute ( ` ${ constants_1 . repositoryPath } ${ constants_1 . action . branch } ` , constants_1 . workspace ) ; yield execute_1 . execute ( ` ` , constants_1 . workspace ) ; } catch ( error ) { core . setFailed ( ` ${ error } ; } finally { return Promise . resolve ( "Deployment branch creation step complete... ✅"); } } ) ; }
Generates the branch if it doesn't exist on the remote.
Generates the branch if it doesn ' t exist on the remote .