Skip to content

Commit

Permalink
Merge pull request #164 from dockstore/feature/seab-6405
Browse files Browse the repository at this point in the history
SEAB-6405: Fix date/folder formatting for github app delivery bucket
  • Loading branch information
hyunnaye authored May 3, 2024
2 parents 1666f6e + 1de63ed commit dadb30e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions upsertGitHubTag/deployment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,11 @@ function processEvent(event, callback) {
function logPayloadToS3(body, deliveryId) {
// If bucket name is not null (had to put this for the integration test)
if (process.env.BUCKET_NAME) {
const uploadDate = new Date();
const bucketPath = `${uploadDate.getFullYear()}
-${uploadDate.getMonth() + 1}
-${uploadDate.getDate()}/${deliveryId}`; //formats path to YYYY-MM-DD/deliveryid
const date = new Date();
const uploadYear = date.getFullYear();
const uploadMonth = (date.getMonth() + 1).toString().padStart(2, "0"); // ex. get 05 instead of 5 for May
const uploadDate = date.getDate().toString().padStart(2, "0"); // ex. get 05 instead of 5 for the 5th date
const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate}/${deliveryId}`;

const command = new PutObjectCommand({
Bucket: process.env.BUCKET_NAME,
Expand Down

0 comments on commit dadb30e

Please sign in to comment.