- Notifications
You must be signed in to change notification settings - Fork0
A small HTTP server using node.js and the hapi framework, that enables you to trigger GitHub Actions workflows using simple links.
License
simbo/github-workflow-dispatcher
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A small HTTP server using node.js and thehapi framework,that enables you to trigger GitHub Actions workflows using simple links (akaHTTPGET
requests).
As you might know, GitHub Actions workflows can be triggered on demand using theworkflow_dispatch
event. However, to trigger such an event, a HTTPPOST
request with payload andauthentication is required. That way, you are not able to trigger a workflowusing a simple link.
TheGitHub Workflow Dispatcher solves this problem. It offers aGET
routethat can pass-through aworkflow_dispatch
event with optional inputs to theGitHub API. For authentication, it uses GitHub OAuth to create a user token thatis used for further requests. This way it is ensured, that only users withsufficient privileges can trigger a workflow.
To useGitHub Workflow Dispatcher with your GitHub Enterprise environment, youneed to host your own instance using the respectiveenvironment options.
General
- 👔 full support for GitHub Enterprise (and also GitHub.com, of course)
- 🪪 using actual user privileges for accessing repository workflows
- 🐳 prepared for containerized deployment using Docker
- 🛠️ customizable configuration depending on environment
- 🧑💻 native Typescript project following strict rules and latest ECMAScriptstandards
Backend
- 🧩 modular architecture via hapi's plugin system
- 🐙 GitHub OAuth and API implementation using latest specification andofficial
@octokit/*
packages - 🗄️ server-side in-memory caching of precompiled responses
- 🔒 secure cookie storage of authorization artifacts using AES 256 CBCencryption
- 🎈 no persistent storage required
Frontend
- 💎 slick and simple, GitHub-inspired design
- 🪄 in-place usage documentation including dispatch URL generator
- 🤝 meaningfull error pages
- 🚀 optimized CSS and JavaScript assets without frameworks or 3rd-partydependencies
- 🌗 switching light and dark theme depending on user preference
- node.js >= 18.x
- git-secret
- docker (optional)
This project usesgit-secret
tostore sensitive information in the git repository.
Before being able to decrypt the respective files, your public GPG key needs tobe added to the list of allowed users.
# clone projectgit clone git@github.com:simbo/github-workflow-dispatcher.git# install dependenciesnpm i# decrypt secret filesgit secret reveal# start watch tasks for server, js and css concurrentlynpm start
The project contains aDockerfile
to create an image.
The docker build expects a.env-production
file to be present (revealed).
# build docker imagedocker build -t github-workflow-dispatcher:VERSION.# start docker containerdocker run -itd -p 8080:3000 -e BASE_URL=http://localhost:8080/ github-workflow-dispatcher:VERSION
About
A small HTTP server using node.js and the hapi framework, that enables you to trigger GitHub Actions workflows using simple links.