diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-03-22 11:19:36 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2025-03-22 11:23:16 -0400 |
| commit | 4fabfa9dbf728f7aaccb74383a3c5c84f96cd314 (patch) | |
| tree | ae816399f3f0469bc6e7d2250e1488588b2727fc /cmd/containerbuild/main.go | |
| parent | 15d801be7de4cd9eea91bcec177b30d1bc15310b (diff) | |
| download | anubis-fix-prs.tar.xz anubis-fix-prs.zip | |
Fix docker image CI for pull requestsfix-prs
Closes #65
Pull request images will now be `ttl.sh/techaro/pr-{number}/anubis:24h`.
Diffstat (limited to 'cmd/containerbuild/main.go')
| -rw-r--r-- | cmd/containerbuild/main.go | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/cmd/containerbuild/main.go b/cmd/containerbuild/main.go index 022cb7b..95194c6 100644 --- a/cmd/containerbuild/main.go +++ b/cmd/containerbuild/main.go @@ -23,21 +23,8 @@ var ( githubEventName = flag.String("github-event-name", "", "GitHub event name") pullRequestID = flag.Int("pull-request-id", -1, "GitHub pull request ID") slogLevel = flag.String("slog-level", "INFO", "logging level (see https://pkg.go.dev/log/slog#hdr-Levels)") - - knownContributors = []string{ - "Xe", - } ) -func inList(needle string, haystack []string) bool { - for _, h := range haystack { - if h == needle { - return true - } - } - return false -} - func main() { flagenv.Parse() flag.Parse() @@ -46,11 +33,7 @@ func main() { koDockerRepo := strings.TrimRight(*dockerRepo, "/"+filepath.Base(*dockerRepo)) - if *githubEventName == "pull_request" && !inList(*githubActor, knownContributors) { - if *pullRequestID == -1 { - log.Fatal("Must set --pull-request-id when --github-event-name=pull_request") - } - + if *githubEventName == "pull_request" && *pullRequestID != -1 { *dockerRepo = fmt.Sprintf("ttl.sh/techaro/pr-%d/anubis", *pullRequestID) *dockerTags = fmt.Sprintf("ttl.sh/techaro/pr-%d/anubis:24h", *pullRequestID) koDockerRepo = fmt.Sprintf("ttl.sh/techaro/pr-%d", *pullRequestID) |
