{"action":"created","issue":{"url":"https://api.github.com/repos/drone/drone/issues/2434","repository_url":"https://api.github.com/repos/drone/drone","labels_url":"https://api.github.com/repos/drone/drone/issues/2434/labels{/name}","comments_url":"https://api.github.com/repos/drone/drone/issues/2434/comments","events_url":"https://api.github.com/repos/drone/drone/issues/2434/events","html_url":"https://github.com/drone/drone/pull/2434","id":331124513,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzOTMyNDI4","number":2434,"title":"Fix out-of-bounds error when a push doesn't contain commits","user":{"login":"typeless","id":2606021,"node_id":"MDQ6VXNlcjI2MDYwMjE=","avatar_url":"https://avatars1.githubusercontent.com/u/2606021?v=4","gravatar_id":"","url":"https://api.github.com/users/typeless","html_url":"https://github.com/typeless","followers_url":"https://api.github.com/users/typeless/followers","following_url":"https://api.github.com/users/typeless/following{/other_user}","gists_url":"https://api.github.com/users/typeless/gists{/gist_id}","starred_url":"https://api.github.com/users/typeless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typeless/subscriptions","organizations_url":"https://api.github.com/users/typeless/orgs","repos_url":"https://api.github.com/users/typeless/repos","events_url":"https://api.github.com/users/typeless/events{/privacy}","received_events_url":"https://api.github.com/users/typeless/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-06-11T10:06:37Z","updated_at":"2018-10-16T19:03:16Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/drone/drone/pulls/2434","html_url":"https://github.com/drone/drone/pull/2434","diff_url":"https://github.com/drone/drone/pull/2434.diff","patch_url":"https://github.com/drone/drone/pull/2434.patch"},"body":"This happens when I push a new tag with `git tag -af foo -m \"bar\" && git push --tags`. Both the 'create' and 'push' events are triggered.\r\nThe log of the drone server would show an internal panic like the following:\r\n\r\n```\r\n2018/06/11 08:34:56 [Recovery] panic recovered:\r\nPOST /hook?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXh0IjoibXVyYS9OVFREQVRBLXBsdWdpbiIsInR5cGUiOiJob29rIn0.IDq3cvR1LNHTvtrWWrmqW4GfyterT8B4tKS_MDUFBMQ HTTP/1.1\r\nHost: 192.120.100.224\r\nAccept-Encoding: gzip\r\nContent-Length: 2902\r\nContent-Type: application/json\r\nUser-Agent: GiteaServer\r\nX-Gitea-Delivery: ad3bd9f2-571d-4dac-91d7-ec6b63baf5e7\r\nX-Gitea-Event: push\r\nX-Github-Delivery: ad3bd9f2-571d-4dac-91d7-ec6b63baf5e7\r\nX-Github-Event: push\r\nX-Gogs-Delivery: ad3bd9f2-571d-4dac-91d7-ec6b63baf5e7\r\nX-Gogs-Event: push\r\n\r\n\r\nruntime error: index out of range\r\n/usr/local/go/src/runtime/panic.go:489 (0x430c7f)\r\n/usr/local/go/src/runtime/panic.go:28 (0x42f8fe)\r\n/go/src/github.com/drone/drone/remote/gitea/helper.go:91 (0xa1cf2f)\r\n/go/src/github.com/drone/drone/remote/gitea/parse.go:72 (0xa1e61b)\r\n/go/src/github.com/drone/drone/remote/gitea/parse.go:44 (0xa1e471)\r\n/go/src/github.com/drone/drone/remote/gitea/gitea.go:338 (0xa1c4db)\r\n/go/src/github.com/drone/drone/server/hook.go:72 (0x932cd4)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/context.go:97 (0x88800a)\r\n/go/src/github.com/drone/drone/router/middleware/token/token.go:31 (0x8a1620)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/context.go:97 (0x88800a)\r\n/go/src/github.com/drone/drone/router/middleware/session/user.go:82 (0x8a0ac2)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/context.go:97 (0x88800a)\r\n/go/src/github.com/drone/drone/router/middleware/store.go:29 (0x9a0fa7)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/context.go:97 (0x88800a)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/contrib/ginrus/ginrus.go:26 (0x9a13ff)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/context.go:97 (0x88800a)\r\n/go/src/github.com/drone/drone/router/middleware/header/header.go:39 (0x898630)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/context.go:97 (0x88800a)\r\n/go/src/github.com/drone/drone/router/middleware/header/header.go:31 (0x8985d9)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/context.go:97 (0x88800a)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/recovery.go:45 (0x89629a)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/context.go:97 (0x88800a)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/gin.go:284 (0x88de40)\r\n/go/src/github.com/drone/drone/vendor/github.com/gin-gonic/gin/gin.go:265 (0x88d75b)\r\n/usr/local/go/src/net/http/server.go:2568 (0x6cc862)\r\n/usr/local/go/src/net/http/server.go:1825 (0x6c8a02)\r\n/usr/local/go/src/runtime/asm_amd64.s:2197 (0x45f881)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/drone/drone/issues/comments/430359010","html_url":"https://github.com/drone/drone/pull/2434#issuecomment-430359010","issue_url":"https://api.github.com/repos/drone/drone/issues/2434","id":430359010,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDM1OTAxMA==","user":{"login":"bradrydzewski","id":817538,"node_id":"MDQ6VXNlcjgxNzUzOA==","avatar_url":"https://avatars1.githubusercontent.com/u/817538?v=4","gravatar_id":"","url":"https://api.github.com/users/bradrydzewski","html_url":"https://github.com/bradrydzewski","followers_url":"https://api.github.com/users/bradrydzewski/followers","following_url":"https://api.github.com/users/bradrydzewski/following{/other_user}","gists_url":"https://api.github.com/users/bradrydzewski/gists{/gist_id}","starred_url":"https://api.github.com/users/bradrydzewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradrydzewski/subscriptions","organizations_url":"https://api.github.com/users/bradrydzewski/orgs","repos_url":"https://api.github.com/users/bradrydzewski/repos","events_url":"https://api.github.com/users/bradrydzewski/events{/privacy}","received_events_url":"https://api.github.com/users/bradrydzewski/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T19:03:16Z","updated_at":"2018-10-16T19:03:16Z","author_association":"MEMBER","body":"@tboerger nope, looks like it needs to be fixed in go-scm for pull requests. The relevant code can be found here https://github.com/drone/go-scm/blob/master/scm/driver/gitea/webhook.go#L197:L209"}}
{"actor":{"display_login":"bradrydzewski"}}