Browse Source

Refactor dirs

Signed-off-by: jolheiser <john.olheiser@gmail.com>
main
jolheiser 3 weeks ago
parent
commit
5e3c895f62
Signed by: jolheiser GPG Key ID: B853ADA5DA7BBF7A
  1. 12
      README.md
  2. 0
      events/README.md
  3. 0
      events/create.json
  4. 0
      events/delete.json
  5. 0
      events/fork.json
  6. 0
      events/issue_assign.json
  7. 0
      events/issue_comment.json
  8. 0
      events/issue_label.json
  9. 0
      events/issue_milestone.json
  10. 0
      events/issues.json
  11. 0
      events/pull_request.json
  12. 0
      events/pull_request_assign.json
  13. 0
      events/pull_request_comment.json
  14. 0
      events/pull_request_label.json
  15. 0
      events/pull_request_milestone.json
  16. 0
      events/pull_request_review_approved.json
  17. 0
      events/pull_request_review_rejected.json
  18. 0
      events/pull_request_sync.json
  19. 0
      events/push.json
  20. 0
      events/release.json
  21. 0
      events/repository.json
  22. 2
      generate.go
  23. 13
      internal/generate.go
  24. 8
      main.go
  25. 0
      web.go

12
README.md

@ -2,7 +2,17 @@
Webhook structs for Gitea webhook payloads.
[Example payloads](internal/events)
[Example payloads](events)
## Generating
There are three required env variables
|Variable|Reason|
|---|---|
|`GITEA_TOKEN`|Gitea token for "main" account to use|
|`GITEA_TOKEN_ALT`|Gitea token for "alt" account (fork, PR review)|
|`WEBHOOK_URL`|URL that _this_ app will be running on|
## License

0
internal/events/README.md → events/README.md

0
internal/events/create.json → events/create.json

0
internal/events/delete.json → events/delete.json

0
internal/events/fork.json → events/fork.json

0
internal/events/issue_assign.json → events/issue_assign.json

0
internal/events/issue_comment.json → events/issue_comment.json

0
internal/events/issue_label.json → events/issue_label.json

0
internal/events/issue_milestone.json → events/issue_milestone.json

0
internal/events/issues.json → events/issues.json

0
internal/events/pull_request.json → events/pull_request.json

0
internal/events/pull_request_assign.json → events/pull_request_assign.json

0
internal/events/pull_request_comment.json → events/pull_request_comment.json

0
internal/events/pull_request_label.json → events/pull_request_label.json

0
internal/events/pull_request_milestone.json → events/pull_request_milestone.json

0
internal/events/pull_request_review_approved.json → events/pull_request_review_approved.json

0
internal/events/pull_request_review_rejected.json → events/pull_request_review_rejected.json

0
internal/events/pull_request_sync.json → events/pull_request_sync.json

0
internal/events/push.json → events/push.json

0
internal/events/release.json → events/release.json

0
internal/events/repository.json → events/repository.json

2
internal/gitea.go → generate.go

@ -62,7 +62,7 @@ func generate(ch chan struct{}) {
if err != nil {
panic(err)
}
// (defer) Delete repo
// (defer) Delete repos
defer func() {
// Sleep to wait for webhooks to finish
time.Sleep(time.Second * 5)

13
internal/generate.go

@ -1,13 +0,0 @@
package main
// 1. Run this webserver.
// 2. Set up a webhook on some hosted Gitea and point it at your URL.
// 3. (Manually) trigger all webhooks. Don't worry about duplicates, they will overwrite.
func main() {
go web()
ch := make(chan struct{}, 1)
go generate(ch)
<-ch
}

8
main.go

@ -0,0 +1,8 @@
package main
func main() {
go web()
ch := make(chan struct{}, 1)
go generate(ch)
<-ch
}

0
internal/web.go → web.go

Loading…
Cancel
Save