Categorygithub.com/iwilltry42/gh-webhook-monitor
repository
0.2.4
Repository: https://github.com/iwilltry42/gh-webhook-monitor.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

gh-webhook-monitor

Prometheus Metrics Exporter for GitHub Repository Webhook Statuses

Overview

Configuration

Via Environment Variables:

Variable NameValue TypeDescriptionDefault Value
GWM_GH_APP_IDintID of your GitHub App-
GWM_GH_APP_PEMstringPath to the private key PEM file of your GitHub App-
GWM_GH_APP_INST_IDintID of the Installation of your GitHub App-
GWM_WAIT_TIMEtime.DurationTime to wait between each loop (important for request limits on the GitHub API)5m
GWM_REPO_REFRESH_WAIT_TIMEtime.DurationTime to wait before refreshing the list of repositories1h
GWM_REPOS_FILTER_TEAM_SLUGSstringComma-separated list of team slugs to get repositories from-
GWM_REPOS_INCLUDEstringComma-separated list of repositories to check the webhooks for-
GWM_REPOS_EXCLUDEstringComma-separated list of repositories to exclude from checks-
GWM_WEBHOOKS_FILTER_TARGET_REGEXPstring (regexp)Regular Expression to filter for specific webhook target URLs (e.g. .*jenkins.*)-
GWM_DEBUGstringset to non-empty to enable debug logging-

Repository Filtering

  • Include always has precedence over exclude (TLDR: INCLUDE > EXCLUDE)
    • E.g. a repo that's listed in GWM_REPOS_INCLUDE will be included, even if it's also in GWM_REPOS_EXCLUDE

Process

  • If GWM_REPOS_FILTER_TEAM_SLUGS is not empty, an initial list of repositories will be fetched from the respective teams
  • From this list, all items will be dropped, which are in the exclusion list created from GWM_REPOS_EXCLUDE
  • Then, all items in the inclusion list (GWM_REPOS_INLCUDE) will be added to the final list