Skip to content

Commit 51a1b8f

Browse files
author
Divya
authored
GitHub action typo (#2843)
* fix: typo * feat: Add labels
1 parent 4e09fc6 commit 51a1b8f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

internal/command/deploy/deploy_build.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ func determineImage(ctx context.Context, appConfig *appconfig.Config) (img *imgs
115115
}
116116
if env.IS_GH_ACTION() {
117117
labels["GH_SHA"] = env.GitCommitSHA()
118+
labels["GH_ACTION_NAME"] = env.GitActionName()
119+
labels["GH_REPO"] = env.GitRepoAndOwner()
118120
labels["GH_EVENT_NAME"] = env.GitActionEventName()
119121
}
120122
if labels != nil {

internal/env/env.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func IsSet(keys ...string) bool {
5555
}
5656

5757
func IS_GH_ACTION() bool {
58-
return IsTruthy("GH_ACTIONS")
58+
return IsTruthy("GITHUB_ACTIONS")
5959
}
6060

6161
func GitCommitSHA() string {
@@ -68,6 +68,16 @@ func GitActionEventName() string {
6868
return eventName
6969
}
7070

71+
func GitActionName() string {
72+
eventName := os.Getenv("GITHUB_ACTION")
73+
return eventName
74+
}
75+
76+
func GitRepoAndOwner() string {
77+
repoAndOwner := os.Getenv("GITHUB_REPOSITORY")
78+
return repoAndOwner
79+
}
80+
7181
// IsCI reports whether the environment is a CI one.
7282
//
7383
// Based on https://github.com/watson/ci-info/blob/c4f1553f254c78babef5c200c48569ede313b718/index.js

0 commit comments

Comments
 (0)