GithubHelp home page GithubHelp logo

Comments (3)

hannesrabo avatar hannesrabo commented on May 29, 2024

Hi, great to hear that you love the tool. When we created it, we only created the url creation for github which is why it looks like that. It would be great to natively support the urls for gitlab as well in my opinion! I don't think that we ever verified that it worked for gitlab unfortunately.

A PR to solve this from you would be the fastest way to get this into the code base if you are interested. Otherwise, feel free to open an issue regarding this 🙂

(Otherwise you could try to create a custom template that works for you)

from semantic-release-slack-bot.

juliuscc avatar juliuscc commented on May 29, 2024

I don't have time to fix this but I can point you in the right direction. I suggest that you extend this file so it figures out the git-service (GitHub, Bitbucket, Gitlab, etc.) and generate an extra property to the return object: release-url which represents the URL to the release. In a first PR you can probably just check if it is gitlab, and leave the current implementation as a default if it is anything other than gitlab.

module.exports = repositoryUrl => {
if (repositoryUrl.startsWith('git@')) {
repositoryUrl = 'ssh://' + repositoryUrl
}
const parsedUrl = new url.URL(
// without these replacements we will get a TypeError [ERR_INVALID_URL]
repositoryUrl.replace(
/\.([a-z])*:/i,
rep => rep.substring(0, rep.length - 1) + '/'
)
)
const path = parsedUrl.pathname
.substring(1) // remove leading "/"
.replace('.git', '') // remove .git
.replace(':', '') // remove any colons from path (present in github for example)
const URL = `https://${parsedUrl.host}/${path}`
return { path, URL }
}

Please add tests here as well:
https://github.com/juliuscc/semantic-release-slack-bot/blob/1cb7fabac9cea86ea7a88a54acae37eccc24d62a/test/getRepoInfo.test.js

from semantic-release-slack-bot.

juliuscc avatar juliuscc commented on May 29, 2024

I'm closing this for inactivity

from semantic-release-slack-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.