Skip to content

fix: release update for goreleaser

Steve Xuereb requested to merge fix/release-project-id into main

Background

In https://ops.gitlab.net/gitlab-com/gl-infra/jsonnet-tool/-/jobs/4830033 we see the job fails because it tried to publish an artifact.

⨯ release failed after 56.26s error=github/gitlab/gitea releases: failed to publish artifacts: POST https://ops.gitlab.net/api/v4/projects/gl-infra/jsonnet-tool/releases: 404 {message: 404 Project Not Found}

If we look at the error message the repository name is incorrect it shouldn't be https://ops.gitlab.net/api/v4/projects/gl-infra/jsonnet-tool/releases but https://ops.gitlab.net/api/v4/projects/gitlab-com/gl-infra/jsonnet-tool/releases. It seems like goreleaser doesn't support nested namespaces (which is GitLab specific).

Solution

Use a predefined variable CI_PROJECT_ID so CI defines the project id. Looking at the source code it seems like it supports templating.

Merge request reports