{"id":21670852,"url":"https://github.com/tkuchiki/ghooks-cmd-runner","last_synced_at":"2025-04-12T02:43:19.583Z","repository":{"id":64304472,"uuid":"58451150","full_name":"tkuchiki/ghooks-cmd-runner","owner":"tkuchiki","description":"Receives Github webhooks and runs commands","archived":false,"fork":false,"pushed_at":"2024-04-25T05:46:05.000Z","size":52,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T22:21:56.266Z","etag":null,"topics":["cli","command","github-webhooks","golang","receives-github-webhooks"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tkuchiki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-10T10:13:51.000Z","updated_at":"2024-05-16T08:25:54.000Z","dependencies_parsed_at":"2024-06-20T08:12:47.413Z","dependency_job_id":"dfa0989c-33b2-40b7-acaa-cf4aebfe9215","html_url":"https://github.com/tkuchiki/ghooks-cmd-runner","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkuchiki%2Fghooks-cmd-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkuchiki%2Fghooks-cmd-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkuchiki%2Fghooks-cmd-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkuchiki%2Fghooks-cmd-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkuchiki","download_url":"https://codeload.github.com/tkuchiki/ghooks-cmd-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248507711,"owners_count":21115662,"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":["cli","command","github-webhooks","golang","receives-github-webhooks"],"created_at":"2024-11-25T12:36:52.829Z","updated_at":"2025-04-12T02:43:19.562Z","avatar_url":"https://github.com/tkuchiki.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ghooks-cmd-runner\nReceives Github webhooks and runs commands\n\n## Installation\n\nDownload from https://github.com/tkuchiki/ghooks-cmd-runner/releases\n\n## Usage\n\n`-c, --config` is required.\n\n```shell\n$ ./ghooks-cmd-runner --help\nusage: ghooks-cmd-runner --config=CONFIG [\u003cflags\u003e]\n\nReceives Github webhooks and runs commands\n\nFlags:\n      --help              Show context-sensitive help (also try --help-long and --help-man).\n  -c, --config=CONFIG     config file location\n  -p, --port=18889        listen port\n      --host=\"127.0.0.1\"  listen host\n  -l, --logfile=LOGFILE   log file location\n      --pidfile=PIDFILE   pid file location\n      --raw-payload       raw payload\n      --version           Show application version.\n```\n\n### Config\n\n```\n# port = 18889 (default: 18889)\n# host = \"0.0.0.0 (default: 127.0.0.1)\"\n# secret = \"your webhook secret\"\n# logfile = \"path to logfile (default: stdout)\"\n# pidfile = \"path to pidfile\"\n\n[[hook]]\nevent = \"push\"\ncommand = \"/path/to/script\"\nbranch = \"feature/*\"\n# exclude_actions = [\"deleted\", \"created\"]\n\n[[hook]]\nevent = \"pull_request\"\ncommand = \"/path/to/script\"\n# call Status API (See: https://developer.github.com/v3/repos/statuses/#create-a-status)\naccess_token = \"your access token\"\ninclude_actions = [ \"opened\", \"reopened\" ]\n# exclude_actions = [ \"closed\", \"unlabeled\" ]\n```\n\nIf you don't want to put secret in Config, alternatively you can store secret in .env file as follows:\n\n```shell\nSECRET_TOKEN=your webhook secret\n```\n\n### Script\n\n```shell\n# read from stdin\ncat - | base64 -d | jq .\n```\n\n```shell\n# change the target_url\necho http://example.com \u003e ${SUCCESS_TARGET_FILE}\necho http://example.com \u003e ${FAILURE_TARGET_FILE}\n```\n\n## Example\n\n```shell\n$ ./ghooks-cmd-runner -c /path/to/config --pidfile /path/to/pid -l /path/to/logfile\nghooks server start 127.0.0.1:18889\n```\n\n## TODO\n\n- Unix Domain Socket\n- Signal handling\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkuchiki%2Fghooks-cmd-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkuchiki%2Fghooks-cmd-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkuchiki%2Fghooks-cmd-runner/lists"}