Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ${nextRelease.version} to label of asset #334

Closed
CosyOranges opened this issue Mar 17, 2022 · 2 comments · Fixed by #365
Closed

Adding ${nextRelease.version} to label of asset #334

CosyOranges opened this issue Mar 17, 2022 · 2 comments · Fixed by #365
Labels

Comments

@CosyOranges
Copy link

Hey not so much an issue as it is a question...

I'm trying to add the nextRelease.version to the label of my asset, but when I do it just comes through as the string for "${nextRelease.version}"

[
            "@semantic-release/gitlab",
            {
                "gitlabUrl": "https://example.com",
                "assets": [
                    {"path": "build.tar.gz", "label": "build-v${nextRelease.version}.tar.gz"}
                ]
            }
]

result:

  "assets": {
    "links": [
      {
        "name": "build-v${nextRelease.version}.tar.gz",
        "url": "https://example/path/.../.../build.tar.gz"
      }
    ]
  }

expected:

  "assets": {
    "links": [
      {
        "name": "build-v1.0.0.tar.gz",
        "url": "https://example/path/.../.../build.tar.gz"
      }
    ]
  }

I've seen that this feature was added in 6.0.4... so it's more a question of where I'm going wrong 😅 ...

@JonasSchubert
Copy link
Contributor

Hi, unfortunately I don't see this (yet) being implemented:

The label is used as a plain string, not as a template: https://github.com/semantic-release/gitlab/blob/master/lib/publish.js#L39=
It should look similar to the success-message: https://github.com/semantic-release/gitlab/blob/master/lib/success.js#L30=

Maybe:

label = template(label)(context);

JonasSchubert added a commit to JonasSchubert/gitlab that referenced this issue Apr 16, 2022
fgreinacher pushed a commit that referenced this issue Apr 28, 2022
As mentioned in #334 it could be useful to use templating for the asset labels. This PR provides the functionality to use the lodash templating functionality similar to the successComment and the failComment.

Resolves #334
@github-actions
Copy link

🎉 This issue has been resolved in version 9.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants