This commit is contained in:
parent
da9bcb415e
commit
e62ed3a4d3
1 changed files with 8 additions and 0 deletions
|
@ -5,6 +5,8 @@ import (
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -219,6 +221,12 @@ func (h webhook) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("runner.Run", err)
|
log.Println("runner.Run", err)
|
||||||
state = "failure"
|
state = "failure"
|
||||||
|
|
||||||
|
if unwrapped := errors.Unwrap(err); unwrapped != nil {
|
||||||
|
if ee, ok := err.(*exec.ExitError); ok {
|
||||||
|
fmt.Fprintf(run, "\n######### Failed with error code %d", ee.ProcessState.ExitCode())
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
err = h.gitea.CreateCommitStatus(hook.Repository.FullName, hook.AfterCommit, gitea.CommitStatus{
|
err = h.gitea.CreateCommitStatus(hook.Repository.FullName, hook.AfterCommit, gitea.CommitStatus{
|
||||||
Context: "repro-run",
|
Context: "repro-run",
|
||||||
|
|
Loading…
Reference in a new issue