Skip to content

Commit 31103af

Browse files
authored
BUGFIX: fix pipelines type and use default branch variable (#22)
1 parent 967ca4a commit 31103af

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.drone.star

+5-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def pipeline_test(ctx):
3737
return new_pipeline(
3838
name="test",
3939
arch="amd64",
40-
trigger={"branch": "main"},
40+
trigger={"branch": ctx.repo.branch},
4141
volumes=[cache_volume],
4242
workspace={"path": "/go/src/github.com/{}".format(ctx.repo.slug)},
4343
steps=[
@@ -126,10 +126,12 @@ def pipeline_manifest(ctx):
126126

127127

128128
def main(ctx):
129-
pipelines = pipeline_test(ctx)
129+
pipelines = [pipeline_test(ctx)]
130130

131131
# only perform image builds for "push" and "tag" events
132-
if ctx.build.branch == "main" and ctx.build.event in ["push", "tag"]:
132+
if ctx.build.event == "tag" or (
133+
ctx.build.branch == ctx.repo.branch and ctx.build.event == "push"
134+
):
133135
pipelines.append(pipeline_build(ctx, "amd64"))
134136
pipelines.append(pipeline_build(ctx, "arm64"))
135137
pipelines.append(pipeline_manifest(ctx))

0 commit comments

Comments
 (0)