Closed kaerbr closed 2 years ago
I would like to be able to set url( and label dynamically).
url
label
Lets say I've set an environment URL in my .gitlab-ci.yml (will be set dynamically in the "real world") :
URL
.gitlab-ci.yml
image: node:lts-alpine stages: - release semantic-release: stage: release script: - export ARTIFACT_URL="https://my.url/to/my/artifact" - apk update && apk upgrade - apk add --no-cache git - npm install -g semantic-release@19 @semantic-release/changelog@6 @semantic-release/exec@6 @semantic-release/git@10 @semantic-release/gitlab@9 - semantic-release --debug
If I try to pass this variable into the gitlab plugin, the variable won't resolve. See .releaserc.yml:
.releaserc.yml
plugins: - "@semantic-release/commit-analyzer" - "@semantic-release/release-notes-generator" - "@semantic-release/changelog" - - "@semantic-release/exec" - prepareCmd: $CI_PROJECT_DIR/.m2/prepare.sh ${nextRelease.version} $CI_PROJECT_DIR publishCmd: $CI_PROJECT_DIR/.m2/publish.sh - - "@semantic-release/git" - assets: - CHANGELOG.md - "**/*pom.xml" - - "@semantic-release/gitlab" - assets: - url: $ARTIFACT_URL label: "my-artifact" type: other branches: - main
This will result in the following JSON payload that will be send to the gitlab releases API:
"assets": { "links": [ { "name": "URL", "url": "$ARTIFACT_URL", "link_type": "other" } ] }
and will result in an error cause gitlab checks the url field to really be a URL.
So my question: Is there any supported way of giving custom variable inputs to the gitlab plugin? (:
I guess, that my question points into a similar direction:
Yes, I think we can close this in favor of https://github.com/semantic-release/gitlab/issues/406.
Closing in favour of #406
I would like to be able to set
url
( andlabel
dynamically).Lets say I've set an environment
URL
in my.gitlab-ci.yml
(will be set dynamically in the "real world") :If I try to pass this variable into the gitlab plugin, the variable won't resolve. See
.releaserc.yml
:This will result in the following JSON payload that will be send to the gitlab releases API:
and will result in an error cause gitlab checks the
url
field to really be a URL.So my question: Is there any supported way of giving custom variable inputs to the gitlab plugin? (: