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

Is there any way we can query the project's ID automatically via API #36

Open
emmeowzing opened this issue Jun 5, 2023 · 1 comment
Assignees

Comments

@emmeowzing
Copy link
Owner

We already request users provide a key. I wonder if we can just query the gitlab instance's API and check for the project's ID automatically and drop that requirement.

@emmeowzing emmeowzing self-assigned this Jun 5, 2023
@settings settings bot removed the feature label Dec 15, 2023
@jzenoz
Copy link

jzenoz commented Jul 2, 2024

quick and dirty POC using an ssh remote url and jq:

curl -Ss --header "PRIVATE-TOKEN: <TOKEN>" "https://$(git remote get-url origin | sed 's/git@//;s/:.*//')/api/v4/projects/$(git remote get-url origin | sed 's/\.git//;s/.*://;s|/|%2F|g')" | jq .id

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

No branches or pull requests

2 participants