No description
  • TypeScript 95%
  • JavaScript 5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Adrien Pessu f2b1c16997
Merge pull request #30 from github/dependabot/npm_and_yarn/npm_and_yarn-12e371b883
Bump undici from 5.29.0 to removed in the npm_and_yarn group across 1 directory
2026-03-31 17:54:00 +02:00
.github/workflows Update eslint.yml 2024-01-08 17:52:53 +00:00
.vscode Initial commit 2023-11-09 16:17:06 +00:00
src/functions Refactor event filtering logic and add filter config type (#12) 2024-01-15 16:55:12 +00:00
test Add filtering 2024-01-15 16:19:58 +00:00
.eslintignore Ignore jest.config.js for ESLint 2024-01-12 16:39:07 +00:00
.eslintrc.json Ignore "prettier" rules in ESLint 2024-01-12 14:36:50 +00:00
.funcignore Add filtering 2024-01-15 16:19:58 +00:00
.gitignore Add filtering 2024-01-15 16:19:58 +00:00
CHANGELOG.md Add supporting docs 2023-12-19 10:01:15 +00:00
CODE_OF_CONDUCT.md Add supporting docs 2023-12-19 10:01:15 +00:00
CODEOWNERS Update CODEOWNERS 2024-01-08 17:18:20 +00:00
CONTRIBUTING.md Updated CONTRIBUTING 2024-01-15 17:27:19 +00:00
filter.yml Add filtering 2024-01-15 16:19:58 +00:00
filter.yml.example Add filtering 2024-01-15 16:19:58 +00:00
host.json Initial commit 2023-11-09 16:17:06 +00:00
INSTALL.md Updated README and INSTALL 2024-01-15 17:20:33 +00:00
jest.config.js Make it work 2023-11-09 22:13:39 +00:00
LICENSE Add supporting docs 2023-12-19 10:01:15 +00:00
package-lock.json Bump undici in the npm_and_yarn group across 1 directory 2026-02-03 08:52:32 +00:00
package.json Bump undici in the npm_and_yarn group across 1 directory 2026-02-03 08:52:32 +00:00
PRIVACY.md Add supporting docs 2023-12-19 10:01:15 +00:00
README.md Updated README and INSTALL 2024-01-15 17:20:33 +00:00
SECURITY.md Add supporting docs 2023-12-19 10:01:15 +00:00
SUPPORT.md Add supporting docs 2023-12-19 10:01:15 +00:00
tsconfig.json More README and minor updates 2023-12-15 15:36:27 +00:00

GitHub Azure Function to mirror GitHub repository events

This is an unofficial tool created by Field Security Services, and is not officially supported by GitHub.

This Azure Function mirrors GitHub events back to a GitHub repo as a repository_dispatch event.

This is necessary since not all GitHub events can trigger an Actions workflow. For example, the pull_request_review event cannot trigger a workflow.

⚠️ Some repository events can contain sensitive information. See more in "Security Considerations" below.

It needs you to deploy the function on Azure, and to create a GitHub App and install it on an org or repo.

This is an unofficial tool created by Field Security Services, and is not officially supported by GitHub.

How it works

The Azure Function is triggered by a GitHub webhook event, via the GitHub App. The Function sends a repository_dispatch event to the GitHub repo, with the same payload as the original event.

sequenceDiagram
    participant GA as GitHub App
    participant AF as Azure Function
    participant GR as GitHub Repo
    participant AW as Actions Workflow
    GR->>GA: GitHub event
    GA->>AF: Triggers Azure Function via webhook
    AF->>GR: Sends `repository_dispatch` event
    GR->>AW: Triggers GitHub Actions workflow

Requirements

  • an Azure account on an Azure subscription
  • a GitHub account

Filter events

Before you deploy, you can choose to set a declarative filter to apply to GitHub events you receive in the Azure Functions App. This is in addition to selecting the events you choose to listen for in the GitHub App.

This is done in the fiter.yml file, with the format shown in filter.yml.example and below:

# Path: filter.yml

# filter webhook events by type and payload, declaratively

include:
  secret_scanning_alert:
    action: [created, dismissed, resolved, reopened]

exclude:
  secret_scanning_alert:
    action: reopened
  secret_scanning_alert_location:

The corresponding exclude filter for an event name is applied after the include filter.

This example will include any event named secret_scanning_alert with an action of created, dismissed, or resolved, reopened and will exclude any event named secret_scanning_alert with an action of reopened. It will also exclude any event named secret_scanning_alert_location.

The presence of an include filter here means that excluding secret_scanning_alert_location is redundant, as it will never be included in the first place, but it is included to show the syntax.

If you do not want to use a filter, you can delete the filter.yml file, or leave it empty.

You do not need to provide both an include and exclude key.

Installing

See INSTALL.md for details.

Create a GitHub Actions workflow

Once the mirror is set up and working, you need to create a GitHub Actions workflow that will run in response to a repository_dispatch event.

It should trigger like so:

on:
  repository_dispatch:
    types: [...]

where types is a list of the types of GitHub events you want to trigger the workflow.

The content of the event will be available in the github.event context variable, and the payload will be available at github.event.client_payload.

License

This project is licensed under the terms of the MIT open source license. Please refer to the LICENSE for the full terms.

Maintainers

See CODEOWNERS for the list of maintainers.

Support

This is an unofficial tool created by Field Security Services, and is not officially supported by GitHub.

See the SUPPORT file.

Security Considerations

Some GitHub repository events contain sensitive data that is usually only available to users with privileged access on a repository.

If you use this event mirror, then anyone with repository write access can create a workflow that will be triggered by the events you mirror, which means they will also get full access to the content of that event.

To repeat: some events can contain sensitive information. Consider carefully whether to allow access to anyone with write access the ability to read an event before you mirror it back to the repository.

Background

See the CHANGELOG, CONTRIBUTING, SECURITY, SUPPORT, CODE OF CONDUCT and PRIVACY files for more information.