paulirish / git-open

Type `git open` to open the GitHub page or website for a repository in your browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Open CI URL

arunvelsriram opened this issue · comments

Add a flag to open CI/CD tool URL:

git open --cx

Based on the contents of the repo we could identify the CI URLs. However, there are a lot of limitations. For travis, circleci etc. we could identify the URL easily but for self-hosted CI/CD tools like GoCD, Jenkins it will be difficult.

Adding this idea here so that someone could come up with a better way to do it. Let me know if this feature makes sense.

Since GitLab has CI/CD build in adding /pipelines to the base url of the repo gets the job done.

For travis, circleci etc. we could identify the URL easily...

How?

This would be really nice.
Now Github has Github Actions (adding /actions to the base url)
And Bitbucket has Bitbucket Pipelines (adding /addon/pipelines/home to the base url).

Would you consider a PR for this? 😄

Edit: If .travis.yml file is present, ir could open https://travis-ci.org/{username}/{repo}
I guess that CircleCI and other SaaS CI providers have similar behaviours.

If .travis.yml file is present, ir could open https://travis-ci.org/{username}/{repo}

Not sure is there is an easy way for the batch script to check if the file exists in the root of the project. You can be a couple of subdirectories deep. As far as I know git ls-files doesn't help you with that either.

I made some googling and git rev-parse --show-toplevel should do the trick to get the root dir of the repo.

Edit: typo