{"id":13827558,"url":"https://github.com/agrison/harpoon","last_synced_at":"2025-02-26T18:19:03.067Z","repository":{"id":57499108,"uuid":"53439273","full_name":"agrison/harpoon","owner":"agrison","description":"GitHub WebHook server written in Go","archived":false,"fork":false,"pushed_at":"2018-10-10T17:53:15.000Z","size":2659,"stargazers_count":242,"open_issues_count":0,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-20T07:35:28.908Z","etag":null,"topics":["github","go","golang","harpoon","server","tunneling","webhook"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agrison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-08T19:30:38.000Z","updated_at":"2024-07-30T15:36:05.000Z","dependencies_parsed_at":"2022-08-28T14:20:59.015Z","dependency_job_id":null,"html_url":"https://github.com/agrison/harpoon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fharpoon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fharpoon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fharpoon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fharpoon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrison","download_url":"https://codeload.github.com/agrison/harpoon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240907907,"owners_count":19876698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","go","golang","harpoon","server","tunneling","webhook"],"created_at":"2024-08-04T09:02:01.622Z","updated_at":"2025-02-26T18:19:02.997Z","avatar_url":"https://github.com/agrison.png","language":"Go","readme":"## Harpoon\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/agrison/harpoon)][goreportcard]\n[![Build Status](https://travis-ci.org/agrison/harpoon.svg?branch=master)](https://travis-ci.org/agrison/harpoon)\n\n[goreportcard]: https://goreportcard.com/report/github.com/agrison/harpoon\n\nHarpoon is a simple Go program that listens for GitHub hooks like `push` on specific git repository `refs` and execute\na defined command when it occurs.\n\nIt can be configured in a TOML configuration file.\n\nThat's nothing fancy, just didn't want to install the whole nodejs + npm or Apache + PHP just for this.\n\n### Install\n\n```sh\ngo get github.com/agrison/harpoon\ngo build\n```\n\nAdd it to your path if you want.\n\n### Runnning\n\n#### Configuration\n\nYou must have a `config.toml` file located in your directory.\n\nThis is a sample TOML file:\n\n```toml\nport = 9001\naddr = \"0.0.0.0\"\n# tunneling stuff\ntunnel = true\ntunnelName = \"foobarbazz\"\n\n[events.\"push:foo/bar:refs/heads/develop\"]\ncmd = \"echo\"\nargs = \"Push!\"\n\n[events.\"watch:foo/bar:refs/heads/develop\"]\ncmd = \"echo\"\nargs = \"Watch!\"\n```\n\nAs you can see events and refs can be configured in the `events` TOML table section.\n\nThese keys have the following format `events.{event}:{repository}:{ref}` where `{event}` refers to a GitHub WebHook event\nlike `push`, `watch`, `pull_request`, ...; `{repository}` is the GitHub repository name and `{ref}` refers to a ref in your git repository like `refs/heads/master` or `refs/tags/v0.0.1`.\n\nFor the above example, it will echo `Push!` when something has been pushed to the `develop` branch of your GitHub repository. \nIt will also echo `Watch!` if someone stars it.\n\n#### Tunneling\n\nTunneling can be enabled using `localtunnel.me`, you just have to enable it in the `config.toml` and indicate a desired subdomain using the `tunnelName` field.\nIf no `tunnelName` is provided then `localtunnel.me` will give you a random subdomain, this subdomain is printed in the console logs.\n\n#### Really running\n\n```sh\nharpoon\n```\n\nor to have it verbose (use `-vt` also if you want logs about `localtunnel.me`):\n```sh\nharpoon -v\n```\n\nIt will output something like this when running:\n```\n    __\n   / /_  ____ __________  ____  ____  ____\n  / __ \\/ __ `/ ___/ __ \\/ __ \\/ __ \\/ __ \\\n / / / / /_/ / /  / /_/ / /_/ / /_/ / / / /\n/_/ /_/\\__,_/_/  / .___/\\____/\\____/_/ /_/\n                /_/\n\tListening on 0.0.0.0:9001\n    \npush detected on foo/bar with ref refs/heads/develop with the following commits:\n\t2016-03-08 13:59:38 +0100 CET - adding some awesomeness by Foo Bar\n\t2016-03-08 13:59:57 +0100 CET - forgot the unicorn png by Foo Bar\n\t2016-03-08 14:01:12 +0100 CET - so much joy in one commit by Foo Bar\n\u003e Push!\n```\n\n\nObviously, the command should be something like `/path/to/pull-build-n-deploy.sh` where some awesome stuff is going on. \nLike something involving git, maven, rake, npm, bower, I don't know, this is your job :)\n\n### Security\n\n`POST` requests made by GitHub are validated against the `X-Hub-Signature` if the environment variable `GITHUB_HOOK_SECRET_TOKEN` is set.\nIt must be the same as the one defined on the GitHub's WebHook page.\n\n### Thanks\n\n- [https://mholt.github.io/json-to-go/](https://mholt.github.io/json-to-go/)\n- [https://github.com/BurntSushi/toml](https://github.com/BurntSushi/toml)\n- [https://github.com/fatih/color](https://github.com/fatih/color)\n- [https://github.com/gorilla/mux](https://github.com/gorilla/mux)\n- [https://github.com/NoahShen/gotunnelme](https://github.com/NoahShen/gotunnelme)\n\n### Licence\nMIT\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrison%2Fharpoon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrison%2Fharpoon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrison%2Fharpoon/lists"}