Skip to content
This repository was archived by the owner on Apr 18, 2020. It is now read-only.

Commit a036012

Browse files
committed
Fixed: sometimes read wrong env variable for branch
1 parent b78bfaf commit a036012

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

modules/status/lambda/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@
1919
# IN THE SOFTWARE.
2020

2121
include ../../../share/lambda/Makefile
22+
23+
# -----------------------------------------------------------------------------
24+
# Target hooks
25+
# -----------------------------------------------------------------------------
26+
27+
# Include assets in distribution files
28+
dist-post:
29+
@(cd dist && cp -r ../src/badges .)

modules/status/lambda/dist.zip

2.94 KB
Binary file not shown.

modules/status/lambda/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ export default (event: CodeBuildPhaseChange, _: Context, cb: Callback) => {
200200
[state, description] = ["success", "Build successful"]
201201

202202
/* Resolve build reference and run URL */
203-
const ref = info.environment["environment-variables"][0].value
203+
const ref = info.environment["environment-variables"].find(variable => { // TODO: needs some refactoring
204+
return variable.name === "GIT_BRANCH"
205+
})!.value
204206
const run = event.detail["build-id"].split(":").pop()
205207
const url = `https://console.aws.amazon.com/codebuild/home?region=${
206208
process.env.AWS_REGION}#/builds/${repo}:${run}/view/new`

0 commit comments

Comments
 (0)