{"id":15406778,"url":"https://github.com/dannyben/loadrunner","last_synced_at":"2025-04-18T03:17:24.763Z","repository":{"id":56881764,"uuid":"100109955","full_name":"DannyBen/loadrunner","owner":"DannyBen","description":"GitHub Webhook Server and Event Simulator","archived":false,"fork":false,"pushed_at":"2024-02-26T17:37:11.000Z","size":119,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-19T14:06:02.400Z","etag":null,"topics":["gem","github-webhooks","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/DannyBen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2017-08-12T12:08:04.000Z","updated_at":"2024-04-02T22:48:20.000Z","dependencies_parsed_at":"2024-02-26T18:47:02.455Z","dependency_job_id":"ae1877c8-5808-4d3e-9742-4d9bc6424d44","html_url":"https://github.com/DannyBen/loadrunner","commit_stats":{"total_commits":107,"total_committers":2,"mean_commits":53.5,"dds":0.4299065420560748,"last_synced_commit":"311266ff5efefc23336f3894fbc86db9b7f87a67"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Floadrunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Floadrunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Floadrunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Floadrunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DannyBen","download_url":"https://codeload.github.com/DannyBen/loadrunner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241367913,"owners_count":19951444,"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":["gem","github-webhooks","ruby"],"created_at":"2024-10-01T16:25:19.900Z","updated_at":"2025-03-01T12:33:08.706Z","avatar_url":"https://github.com/DannyBen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Loadrunner - GitHub Webhook Server and Event Simulator\n======================================================\n\n[![Gem Version](https://badge.fury.io/rb/loadrunner.svg)](https://badge.fury.io/rb/loadrunner)\n[![Build Status](https://github.com/DannyBen/loadrunner/workflows/Test/badge.svg)](https://github.com/DannyBen/loadrunner/actions?query=workflow%3ATest)\n[![Maintainability](https://api.codeclimate.com/v1/badges/f1aae46eaf6365ea2ec7/maintainability)](https://codeclimate.com/github/DannyBen/loadrunner/maintainability)\n\n---\n\nLoadrunner is a multi-purpose utility for working with GitHub webhooks and \nstatuses.\n\nIt provides these features:\n\n- A web server that responds to GitHub webhook events and can run any \n  arbitrary script written in any language.\n- A command line utility for testing your webhook server configuration by\n  sending simulated events.\n- A command line utility for sending status updates to pull requests.\n\n---\n\n\n\nInstall\n--------------------------------------------------\n\n```\n$ gem install loadrunner\n```\n\n\n\nGetting Started\n--------------------------------------------------\n\n1. Download the [hooks](hooks) directory from this repository, as an\n   example. This directory contains several hook examples.\n2. Make sure that all files within that folder are executable.\n3. Start the server (from the `hooks` **parent** directory):\n   `loadrunner server`\n4. In another terminal, send a sample webhook event:\n   `loadrunner event localhost:3000 myrepo push master`\n\nThe server should respond with a detailed JSON response, specifying what\nhooks were executed (`executed_hooks`) and what hooks *could have\nbeen* executed, if they were defined in the hooks folder\n(`matching_hooks`).\n\n\nFor more options, see the [documentation][1] or run\n\n```shell\n$ loadrunner --help\n```\n\n\n\nBuilding Hooks\n--------------------------------------------------\n\nWhen running the server, it will look for hooks (executable scripts) in\nthe `./hooks` directory, using one of these format:\n\n    hooks/global\n    hooks/\u003crepo name\u003e/global\n    hooks/\u003crepo name\u003e/\u003cevent type\u003e\n    hooks/\u003crepo name\u003e/\u003cevent type\u003e@branch=\u003cbranch name\u003e\n    hooks/\u003crepo name\u003e/\u003cevent type\u003e@tag=\u003ctag name\u003e\n    hooks/\u003crepo name\u003e/\u003cevent type\u003e@tag\n\nFor example:\n\n    hooks/global\n    hooks/myrepo/global\n    hooks/myrepo/push\n    hooks/myrepo/push@branch=master\n    hooks/myrepo/push@tag=release\n    hooks/myrepo/push@tag\n\nWhen none of the hooks are found, Loadrunner will respond with a list of\nhooks it was looking for, so you can use this response to figure out what\nit needs.\n\nThe hooks can be written in any language, and should simply be executable.\n\n### Environment Variables\n\nThese environment variables are available to your hooks:\n\n- `LOADRUNNER_REPO`\n- `LOADRUNNER_OWNER`\n- `LOADRUNNER_EVENT`\n- `LOADRUNNER_BRANCH`\n- `LOADRUNNER_COMMIT`\n- `LOADRUNNER_REF`\n- `LOADRUNNER_TAG`\n\n\n\nUsing as a Rack or Sinatra mount\n--------------------------------------------------\n\nIf you wish to mount the Loadrunner server under another Rack or Sinatra\napplication, use the `Loadrunner::Server` as the handler.\n\n\n```ruby\n# config.ru\nrequire \"loadrunner/server\"\n\nmap \"/github\" do\n  run Loadrunner::Server\nend\n\nrun YourOwnApp\n```\n\n\n\nSending Pull Request status from Ruby code\n--------------------------------------------------\n\nYou may use the `Loadrunner::Status` class to update the status of a\nGitHub pull request.\n\nFirst, make sure that your GitHub API access token is set in the environment\nvariable `GITHUB_ACCESS_TOKEN`.\n\n```ruby\nrequire 'loadrunner/status'\n\nresponse = Loadrunner::Status.update repo: 'user/repo', \n  sha: 'commit sha string', \n  state: :pending,  # :pending :success :failure :error\n  context: \"My Hooks Server\",\n  description: \"Jobs have not started yet\",\n  url: \"http://example.com\"\n```\n\nOnly `repo`, `sha` and `state` are required, the rest arguments are optional.\n\n\n\nRunning with Docker\n--------------------------------------------------\n\nYou can run both the server and the client using Docker.\n\n```shell\n# Server\n$ docker run -p3000:3000 dannyben/loadrunner server\n\n# Client\n$ docker run dannyben/loadrunner event http://webhook.server.com repo push\n```\n\nIf you wish to connect the client to the server you are running through Docker, \nyou can do something like this:\n\n```shell\n$ docker run --network host dannyben/loadrunner event http://localhost:3000 repo push\n```\n\nSee also: The [docker-compose file](docker-compose.yml).\n\n[1]: http://www.rubydoc.info/gems/loadrunner\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Floadrunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdannyben%2Floadrunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Floadrunner/lists"}