{"id":21721378,"url":"https://github.com/informaticsmatters/trigger-repository-dispatch","last_synced_at":"2026-05-10T19:54:09.950Z","repository":{"id":80605443,"uuid":"382003460","full_name":"InformaticsMatters/trigger-repository-dispatch","owner":"InformaticsMatters","description":"A Python module to simplify creating GitHub repository dispatch events and payloads","archived":false,"fork":false,"pushed_at":"2024-04-22T19:56:19.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-25T18:43:22.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InformaticsMatters.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-01T11:01:44.000Z","updated_at":"2024-04-22T19:56:22.000Z","dependencies_parsed_at":"2025-01-25T18:42:14.837Z","dependency_job_id":"bd87dcf3-5c61-455e-8243-a72abf313a58","html_url":"https://github.com/InformaticsMatters/trigger-repository-dispatch","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Ftrigger-repository-dispatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Ftrigger-repository-dispatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Ftrigger-repository-dispatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Ftrigger-repository-dispatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InformaticsMatters","download_url":"https://codeload.github.com/InformaticsMatters/trigger-repository-dispatch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244693751,"owners_count":20494503,"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":[],"created_at":"2024-11-26T02:16:11.272Z","updated_at":"2026-05-10T19:54:09.945Z","avatar_url":"https://github.com/InformaticsMatters.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trigger-repository-dispatch\n\n![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/informaticsmatters/trigger-repository-dispatch)\n\nA Python module to simplify creating GitHub repository dispatch events and\npayloads. Used by some of our GitLab repos to trigger builds in GitHub.\n\nTo use in GitLab CI:\n\n```yaml\nvariables:\n  # The origin of the trigger code\n  TRIGGER_ORIGIN: https://raw.githubusercontent.com/informaticsmatters/trigger-repository-dispatch/2021.3\n\ntrigger:\n  stage: trigger\n  image: python:3.12.4\n  tags:\n  script:\n  - apt-get -y update\n  - apt-get -y install curl\n  - curl --location --retry 3 ${TRIGGER_ORIGIN}/requirements.txt --output trigger-repository-dispatch-requirements.txt\n  - curl --location --retry 3 ${TRIGGER_ORIGIN}/trigger-repository-dispatch.py --output trigger-repository-dispatch.py\n  - pip install -r trigger-repository-dispatch-requirements.txt\n  - chmod +x trigger-repository-dispatch.py\n  - ./trigger-repository-dispatch.py ${EVENT} ${REPO} ${TOKEN}\n```\n\nWhere: -\n\n- `EVENT` is the [repository dispatch] **type** that is defined in the repository workflow being triggered (e.g. `my-event`)\n- `REPO` is the repository being triggered (e.g. `informaticsmatters/repo-a`)\n- `TOKEN` is a valid [personal access token] for the `REPO`. The token must permit execution of the chosen [repository dispatch] event **type**\n\nAnd: -\n\nThe repository being triggered defines a [repository dispatch] event: -\n\n```\non:\n  repository_dispatch:\n    types: my-event\n```\n\n## Running the trigger locally\nAlthough designed for us in a CI process you can use the trigger for development.\nYou just need to configure the environment, to simulate what you'd find in the\nCI process.\n\nFirst, it's Python so clone this repository, create an environment, and install\nthe trigger's requirements: -\n\n    cd trigger-repository-dispatch\n    python -m venv venv\n    source venv/bin/activate\n    pip install -r requirements.txt\n\nNow simulate the GitLab environment variables that the tool relies on. You will need to define: -\n\n- `CI_PIPELINE_ID` (A simulated GitLab pipeline ID, any string like \"521115318\")\n- `CI_COMMIT_TAG` (The tag of the origin repo you want to simulate, i.e.\"1.0.0\")\n- `CI_COMMIT_SHORT_SHA`\n- `CI_COMMIT_REF_NAME` (The tag or branch of the origin repo you want to simulate, i.e.\"1.0.0\")\n\nAnd then the details of the [repository dispatch] defined in the client repo: -\n\n- `CLIENT_EVENT`\n- `CLIENT_REPO`\n- `CLIENT_TOKEN`\n\nFor example: -\n\n    export CI_PIPELINE_ID=521115318\n    export CI_COMMIT_TAG=1.0.0\n    export CI_COMMIT_SHORT_SHA=abcdef00\n    export CI_COMMIT_REF_NAME=1.0.0\n\n    CLIENT_EVENT=my-event\n    CLIENT_REPO=informaticsmatters/repo-a\n    CLIENT_TOKEN=000000000\n\nWith these environment variables set you just need to run the trigger...\n\n    ./trigger-repository-dispatch.py ${CLIENT_EVENT} ${CLIENT_REPO} ${CLIENT_TOKEN}\n\n---\n\n[repository dispatch]: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch\n[personal access token]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Ftrigger-repository-dispatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finformaticsmatters%2Ftrigger-repository-dispatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Ftrigger-repository-dispatch/lists"}