Skip to content

Commit

Permalink
Fix image tag regex
Browse files Browse the repository at this point in the history
  • Loading branch information
farski committed Dec 21, 2024
1 parent 944f3ef commit 49f2788
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ci/src/slack-message-handler/builder.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ export async function statusBlocks(event) {
const imageEnvarName = parts[0];
// allEnvVars will have a key-value pair like:
// { MY_APP: "github/prx/my-app:165df6a5fd675dcf67" }
// imageName will be like "github/prx/my-app:165df6a5fd675dcf67"
// imageName will be like:
// "github/prx/my-app:165df6a5fd675dcf67"
// "github/prx/my-app:release-165df6a5fd675dcf67"
// "github/prx/my-app:release-165df6a5fd675dcf67-aarch64"
const imageName = allEnvVars[imageEnvarName];

// For builds that don't publish an image to ECR, this value won't
Expand All @@ -106,7 +109,7 @@ export async function statusBlocks(event) {
// The image tag (truncated), like
// 165df6a
const tag = imageName
.match(/:([a-z\-]+)?([a-f0-9_\-]+)$/)[2]
.match(/:([a-z\-]+)?([a-f0-9]+)(-[a-z0-9_]+)?$/)
.substring(0, 7);

const ecrUrl = `https://${region}.console.aws.amazon.com/ecr/repositories/private/${accountId}/${repoName}?region=${region}`;
Expand Down

0 comments on commit 49f2788

Please sign in to comment.