mirror of
https://github.com/harness/drone.git
synced 2025-05-09 00:22:18 +08:00
refactored field slug to name
This commit is contained in:
parent
89a88256de
commit
dbf43d0a88
@ -102,7 +102,7 @@ func Hook(w http.ResponseWriter, r *http.Request) error {
|
|||||||
|
|
||||||
// get the drone.yml file from GitHub
|
// get the drone.yml file from GitHub
|
||||||
client := github.New(user.GithubToken)
|
client := github.New(user.GithubToken)
|
||||||
content, err := client.Contents.FindRef(repo.Owner, repo.Slug, ".drone.yml", commit.Hash)
|
content, err := client.Contents.FindRef(repo.Owner, repo.Name, ".drone.yml", commit.Hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
msg := "No .drone.yml was found in this repository. You need to add one.\n"
|
msg := "No .drone.yml was found in this repository. You need to add one.\n"
|
||||||
if err := saveFailedBuild(commit, msg); err != nil {
|
if err := saveFailedBuild(commit, msg); err != nil {
|
||||||
@ -218,7 +218,7 @@ func PullRequestHook(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// get the drone.yml file from GitHub
|
// get the drone.yml file from GitHub
|
||||||
client := github.New(user.GithubToken)
|
client := github.New(user.GithubToken)
|
||||||
content, err := client.Contents.FindRef(repo.Owner, repo.Slug, ".drone.yml", commit.Hash) // TODO should this really be the hash??
|
content, err := client.Contents.FindRef(repo.Owner, repo.Name, ".drone.yml", commit.Hash) // TODO should this really be the hash??
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println(err.Error())
|
||||||
RenderText(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
|
RenderText(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
|
||||||
|
Loading…
Reference in New Issue
Block a user