~sircmpwn/builds.sr.ht

81a5f43c01c8b84c713791c8630fc6acb16ac080 — Mark Dain 12 days ago 6e7b19e 0.66.3
Implement CI_NAME=sourcehut

This commit pushes a new environment variable, `CI_NAME' which can be
used to reliably detect if some code is running under builds.sr.ht
1 files changed, 1 insertions(+), 0 deletions(-)

M worker/tasks.go
M worker/tasks.go => worker/tasks.go +1 -0
@@ 175,6 175,7 @@ complete-build() {
	if ctx.Manifest.Environment == nil {
		ctx.Manifest.Environment = make(map[string]interface{})
	}
	ctx.Manifest.Environment["CI_NAME"] = "sourcehut"
	ctx.Manifest.Environment["JOB_ID"] = ctx.Job.Id
	ctx.Manifest.Environment["JOB_URL"] = fmt.Sprintf(
		"%s/~%s/job/%d", origin, ctx.Job.Username, ctx.Job.Id)