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

Fetch specific commit for Gitea #10

Merged
merged 1 commit into from Feb 6, 2019

Conversation

Projects
None yet
4 participants
@techknowlogick
Copy link
Contributor

techknowlogick commented Feb 6, 2019

Hopefully this is suitable to enable cron tasks in Drone for Gitea repos

@tboerger
Copy link
Member

tboerger left a comment

Awesome, thanks a lot!

@bradrydzewski

This comment has been minimized.

Copy link
Member

bradrydzewski commented Feb 6, 2019

this is great, thanks!

@bradrydzewski bradrydzewski merged commit 5312249 into drone:master Feb 6, 2019

1 check passed

continuous-integration/drone/pr Build is passing
Details

@techknowlogick techknowlogick deleted the techknowlogick:fetch-gitea-commit branch Feb 6, 2019

@ogarcia

This comment has been minimized.

Copy link

ogarcia commented Feb 19, 2019

I'm not GO developer but I think that same solution can be used to Gogs since the code is the same. The only difference is in line:

path := fmt.Sprintf("api/v1/repos/%s/git/commits/%s", repo, ref)

That in Gogs not have /git/:

path := fmt.Sprintf("api/v1/repos/%s/commits/%s", repo, ref)

Sample: https://try.gogs.io/api/v1/repos/gogs/gogs/commits/2c3e2b701e012294d457937e6bfbffd63dd8ae4f

Note that you must have authenticated to make this work:

curl -H "Authorization: token YOURTOKEN" https://try.gogs.io/api/v1/repos/gogs/gogs/commits/2c3e2b701e012294d457937e6bfbffd63dd8ae4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment