A repo-watcher to watch for commits on a repo an trigger GitHub action by sending a `repository_dispatch` event to destinantion repo

Overview

repo-watcher-dispatch-sender

Forks Stars Issues LICENSE Contributors Repo Size Views

DeepSource

Join us on Telegram

This app is used to send a repository_dispatch event to the destination repo set in config.py or Environmental Variables whenver a commit is made on the upstream repo.

This setup is for my own use, please fork and make your own if you want :D

Give this repo a if you like it or it helps you!

How to use?

Set the Environmental Variables or config.py file

It's really not difficult to set this up, you just need to define the variables in config file, the varibales include the following:

  • GH_PAT: Github Personal Access Token with repo access to the destination repo. Cause you know, you can't trigger any workflow anywhere except the ones you have acess to :p
  • REPOSITORY_PAIR: The main stuff, this tells the script about source and destination repo, the source repo is the one we check commits for, destination is for sending the repository_dispatch to it. It should be in this format: : : , the source and destination should be in this format: , Example:
  • TIME_PERIOD: The time after which script should sleep for, i.e. wait before running again. It is not recommented to set it to less than 30, default is 60 minutes
  • SLEEP_TIME: The time before performing another action after one has been done, i.e. wait time between 2 consecutive requests. It is not recommented to set it to 0, default is 1 minute
  • EVENT_TYPE: The event which should be sent in repository_dispatch, read more here: docs.github.com
  • DB_URI: MongoDB URL for database usage of bot.

Choose how you want to run it

You can run it in several different ways, one of the easiest might be to use heroku.

Another option is to locally run it on you pc as it is or using docker.

Docker images can be found here: ghcr.io or Docker Hub

You can even easily build your own docker images using the provided dockerfiles!

Running using docker

You can easily use the docker image like this:

" -e REPOSITORY_PAIR=" " -e TIME_PERIOD=60 -e SLEEP_TIME=1 -e EVENT_TYPE=" " -e DB_URI=" " divideprojects/repo-watcher-dispatch-sender:latest ">
docker run -e GH_PAT="
       
        "
        -e REPOSITORY_PAIR="
       
        "
        -e TIME_PERIOD=60 -e SLEEP_TIME=1 -e EVENT_TYPE="
       
        "
        -e DB_URI="
       
        "
        divideprojects/repo-watcher-dispatch-sender:latest

or

" -e REPOSITORY_PAIR=" " -e TIME_PERIOD=60 -e SLEEP_TIME=1 -e EVENT_TYPE=" " -e DB_URI=" " ghcr.io/divideprojects/repo-watcher-dispatch-sender:latest ">
docker run -e GH_PAT="
       
        "
        -e REPOSITORY_PAIR="
       
        "
        -e TIME_PERIOD=60 -e SLEEP_TIME=1 -e EVENT_TYPE="
       
        "
        -e DB_URI="
       
        "
        ghcr.io/divideprojects/repo-watcher-dispatch-sender:latest

These is absolutely no difference between the 2 commands above, you can use any, the first one fetched image from docker hub while other one gets the image from ghcr.io

What is the use of this?

It can be whatever you want it to do, you can use it trigger automatic builds, tests, builds, and a lot of things...

FAQ

Some general questions you might stumble upon

Why can't I trigger to a specific branch on destination repo?

It's not really needed most of time, if you stiff want this feature we'll be happy to merge your pull request for it :)

Why should SLEEP_TIME should not be set to 0?

Every API has limitations, and so is the case with Github, it has a soft-limit of 60 api calls per hour, so we need to make sure that we don't hit the limits.

You might also like...
Upload comma-delimited files to biglocalnews.org in your GitHub Action

Upload comma-delimited files to biglocalnews.org in your GitHub Action Inputs api-key: Your biglocalnews.org API token. project-id: The identifier of

Github action for automatically determine the version for next release by using repository tags

This action will automatically determine the version for next release by using repository tags

A simple script that will watch a stream for you and earn the channel points.
A simple script that will watch a stream for you and earn the channel points.

Credits Main idea: https://github.com/gottagofaster236/Twitch-Channel-Points-Miner Bet system (Selenium): https://github.com/ClementRoyer/TwitchAutoCo

Instagram Story View Bot  Unencrypted Story Views is a helpful tool that allows thousands of people to watch your posts. It is completely free, source is visible for anyone to modify Type your username, wait for the bot to Automate the Task. a simple floating window for watch cryptocurrency price
a simple floating window for watch cryptocurrency price

floating-monitor with cryptocurrency 浮動視窗虛擬貨幣價格監控 a floating monitor window to show price of cryptocurrency. use binance api to get price 半透明的浮動視窗讓你方便

RichWatch is wrapper around AWS Cloud Watch to display beautiful logs with help of Python library Rich.
RichWatch is wrapper around AWS Cloud Watch to display beautiful logs with help of Python library Rich.

RichWatch is TUI (Textual User Interface) for AWS Cloud Watch. It formats and pretty prints Cloud Watch's logs so they are much more readable. Because

Unencrypted Story View Botter is a helpful tool that allows thousands of people to watch your posts.
Unencrypted Story View Botter is a helpful tool that allows thousands of people to watch your posts.

Unencrypted Story View Botter is a helpful tool that allows thousands of people to watch your posts.

REPO USERBOT YANG DIBUAT DARI BERBAGAI REPO USERBOT GITHUB.
REPO USERBOT YANG DIBUAT DARI BERBAGAI REPO USERBOT GITHUB.

Lord Userbot Userbot Yang Digunakan Untuk Bersenang-Senang Di Telegram Repo Lord Userbot Repo Yang Dibuat Alvin Dari Berbagai Repo Userbot Github CARA

A github actions + python code to extract URLs to code repositories to put into standard form, starting with github

A github actions + python code to extract URLs to code repositories to put into standard form, starting with github ---- NOTE: JUS

Owner
Divide Projects™
A simple open source projects orgainisation
Divide Projects™
Extend the commitizen tools to create conventional commits and README that link to Jira and GitHub.

cz-github-jira-conventional cz-github-jira-conventional is a plugin for the commitizen tools, a toolset that helps you to create conventional commit m

null 12 Dec 13, 2022
42-event-notifier - 42 Event notifier using 42API and Github Actions

42 Event Notifier 42서울 Agenda에 새로운 이벤트가 등록되면 알려드립니다! 현재는 Github Issue로 등록되므로 상단

null 6 May 16, 2022
A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

Egarok 2 Jul 20, 2022
Automatically commits and pushes changes from a specified directory to remote repository

autopush a simple python program that checks a directory for updates and automatically commits any updated files (and optionally pushes them) installa

carreb 1 Jan 16, 2022
Battle.net and PlayStation title watcher that reports updates via Discord.

Renovate Renovate is a Battle.net and PlayStation title watcher that reports updates via Discord. Usage Open config_example.json and provide the confi

Ethan 1 Nov 23, 2022
Clipboard-watcher - Keep an eye on the apps that are using your clipboard

clipboard-watcher This repository contains the code of an experiment, in order t

Gonçalo Valério 48 Oct 13, 2022
Auto Join: A GitHub action script to automatically invite everyone to the organization who comment at the issue page.

Auto Invite To Org By Issue Comment A GitHub action script to automatically invite everyone to the organization who comment at the issue page. What is

Max Base 6 Jun 8, 2022
GitHub action to deploy serverless functions to YandexCloud

YandexCloud serverless function deploy action Deploy new serverless function version (including function creation if it does not exist). Inputs yc_acc

Много Лосося 4 Apr 10, 2022
A GitHub Action that automatically reports your Advent of Code progress in a table in your README

Advent README Stars This action adds and maintains a stars report in your README based on your Advent of Code progress. Example Table 2021 Results Day

Kevin Duff 36 Dec 30, 2022
📖 GitHub action schedular (cron) that posts a Hadith every hour on Twitter & Facebook.

Hadith Every Hour ?? A bot that posts a Hadith every hour on Twitter & Facebook (Every 3 hours for now to avoid spamming) Follow on Twitter @HadithEve

Ananto 13 Dec 14, 2022