Skip to content

Commit 84881ca

Browse files
navinsoniEthanShouhanCheng
authored andcommitted
fix: Update '_' and '/' with '-' in filename creation (aws#2728)
1 parent 93ee324 commit 84881ca

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ci-scripts/queue_build.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
from __future__ import absolute_import
1414

1515
import os
16+
import re
1617
import time
18+
1719
import boto3
1820

1921
account = boto3.client(
@@ -23,9 +25,11 @@
2325

2426

2527
def queue_build():
26-
build_id = os.environ.get("CODEBUILD_BUILD_ID", "CODEBUILD-BUILD-ID")
27-
source_version = os.environ.get("CODEBUILD_SOURCE_VERSION", "CODEBUILD-SOURCE-VERSION").replace(
28-
"/", "-"
28+
build_id = re.sub("[_/]", "-", os.environ.get("CODEBUILD_BUILD_ID", "CODEBUILD-BUILD-ID"))
29+
source_version = re.sub(
30+
"[_/]",
31+
"-",
32+
os.environ.get("CODEBUILD_SOURCE_VERSION", "CODEBUILD-SOURCE-VERSION"),
2933
)
3034
ticket_number = int(1000 * time.time())
3135
filename = "%s_%s_%s" % (ticket_number, build_id, source_version)

0 commit comments

Comments
 (0)