Skip to content

Commit 07a98b0

Browse files
committed
fix bucket name
1 parent d326a34 commit 07a98b0

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

dist/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9315,7 +9315,7 @@ exports.default = (bucketName, uploadDirectory, environmentPrefix) => __awaiter(
93159315
console.log('S3 Bucket already exists. Skipping creation...');
93169316
}
93179317
yield deactivateDeployments_1.default(repo, environmentPrefix);
9318-
const deployment = yield githubClient_1.default.repos.createDeployment(Object.assign(Object.assign({}, repo), { ref: `refs/heads/${branchName}`, environment: `${environmentPrefix || 'ACTION-'}${dayjs_1.default().format('DD-MM-YYYY[_]hh:mm:ssa')}`, auto_merge: false, transient_environment: true, required_contexts: [] }));
9318+
const deployment = yield githubClient_1.default.repos.createDeployment(Object.assign(Object.assign({}, repo), { ref: `refs/heads/${branchName}`, environment: `${environmentPrefix || 'ACTION-'}${dayjs_1.default().format('DD-MM-YYYY-hh:mma')}`, auto_merge: false, transient_environment: true, required_contexts: [] }));
93199319
if (isSuccessResponse(deployment.data)) {
93209320
yield githubClient_1.default.repos.createDeploymentStatus(Object.assign(Object.assign({}, repo), { deployment_id: deployment.data.id, state: 'in_progress' }));
93219321
console.log('Uploading files...');
@@ -12209,6 +12209,7 @@ const github = __importStar(__webpack_require__(469));
1220912209
const prClosedAction_1 = __importDefault(__webpack_require__(751));
1221012210
const prUpdatedAction_1 = __importDefault(__webpack_require__(161));
1221112211
const uploadAction_1 = __importDefault(__webpack_require__(228));
12212+
const dayjs_1 = __importDefault(__webpack_require__(874));
1221212213
const main = () => __awaiter(void 0, void 0, void 0, function* () {
1221312214
try {
1221412215
const bucketPrefix = core.getInput('bucket-prefix');
@@ -12235,8 +12236,7 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
1223512236
}
1223612237
}
1223712238
else {
12238-
const lastCommitSha = github.context.sha;
12239-
const bucketName = `${bucketPrefix}-${githubEventName}-${lastCommitSha.slice(0, 7)}`;
12239+
const bucketName = `${bucketPrefix}-${dayjs_1.default().format('DD-MM-YYYY-hh:mma')}`;
1224012240
yield uploadAction_1.default(bucketName, folderToCopy, environmentPrefix);
1224112241
}
1224212242
}

src/actions/uploadAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default async (bucketName: string, uploadDirectory: string, environmentPr
4141
const deployment = await githubClient.repos.createDeployment({
4242
...repo,
4343
ref: `refs/heads/${branchName}`,
44-
environment: `${environmentPrefix || 'ACTION-'}${dayjs().format('DD-MM-YYYY[_]hh:mm:ssa')}`,
44+
environment: `${environmentPrefix || 'ACTION-'}${dayjs().format('DD-MM-YYYY-hh:mma')}`,
4545
auto_merge: false,
4646
transient_environment: true,
4747
required_contexts: []

src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as github from '@actions/github'
33
import prClosedAction from './actions/prClosedAction'
44
import prUpdatedAction from './actions/prUpdatedAction'
55
import uploadAction from './actions/uploadAction'
6+
import dayjs from 'dayjs'
67

78
const main = async () => {
89
try {
@@ -34,9 +35,7 @@ const main = async () => {
3435
break
3536
}
3637
} else {
37-
const lastCommitSha = github.context.sha
38-
39-
const bucketName = `${bucketPrefix}-${githubEventName}-${lastCommitSha.slice(0, 7)}`
38+
const bucketName = `${bucketPrefix}-${dayjs().format('DD-MM-YYYY-hh:mma')}`
4039

4140
await uploadAction(bucketName, folderToCopy, environmentPrefix)
4241
}

0 commit comments

Comments
 (0)