Skip to content

Commit 13046b6

Browse files
committed
Deploy Production Code for Commit f0e6e50 🚀
1 parent f0e6e50 commit 13046b6

File tree

12 files changed

+633
-15
lines changed

12 files changed

+633
-15
lines changed

lib/constants.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export interface ActionInterface {
4949
tokenType?: string;
5050
/** The folder where your deployment project lives. */
5151
workspace: string;
52+
/** GitHub tag name */
53+
tag?: string | null;
5254
}
5355
/** The minimum required values to run the action as a node module. */
5456
export interface NodeActionInterface {

lib/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ exports.action = {
9292
? true
9393
: (0, core_1.getInput)('ssh-key'),
9494
targetFolder: (0, core_1.getInput)('target-folder'),
95-
workspace: process.env.GITHUB_WORKSPACE || ''
95+
workspace: process.env.GITHUB_WORKSPACE || '',
96+
tag: (0, core_1.getInput)('tag')
9697
};
9798
/** Status codes for the action. */
9899
var Status;

lib/git.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,20 @@ function deploy(action) {
180180
pushResult.stdout.includes(`[remote rejected]`);
181181
if (rejected)
182182
(0, core_1.info)('Updates were rejected');
183-
// If the push failed for any reason other than being rejected,
183+
// If the push failed for any fatal reason other than being rejected,
184184
// there is a problem
185-
if (!rejected && pushResult.stderr)
185+
if (!rejected && pushResult.stderr.trim().startsWith('fatal:'))
186186
throw new Error(pushResult.stderr);
187187
} while (rejected);
188188
}
189189
(0, core_1.info)(`Changes committed to the ${action.branch} branch… 📦`);
190+
if (action.tag) {
191+
(0, core_1.info)(`Adding '${action.tag}' tag to the commit…`);
192+
yield (0, execute_1.execute)(`git tag ${action.tag}`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent);
193+
(0, core_1.info)(`Pushing '${action.tag}' tag to repository…`);
194+
yield (0, execute_1.execute)(`git push origin ${action.tag}`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent);
195+
(0, core_1.info)(`Tag '${action.tag}' created and pushed to the ${action.branch} branch… 🏷️`);
196+
}
190197
return constants_1.Status.SUCCESS;
191198
}
192199
catch (error) {

node_modules/@types/node/README.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)