Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/radu-matei/spin-github-webhooks
https://github.com/radu-matei/spin-github-webhooks
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/radu-matei/spin-github-webhooks
- Owner: radu-matei
- Created: 2022-12-24T17:39:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-14T09:29:06.000Z (over 1 year ago)
- Last Synced: 2024-04-14T04:28:19.807Z (7 months ago)
- Language: TypeScript
- Size: 46.9 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub webhooks with Spin and Fermyon Cloud
This repository is a demonstration for building [GitHub webhooks](https://docs.github.com/en/developers/webhooks-and-events/webhooks/about-webhooks)
in TypeScript using Spin and Fermyon Cloud.## Local development
- [Spin](https://developer.fermyon.com/spin)
- [the Spin JavaScript toolchain](https://developer.fermyon.com/spin/javascript-components)
- [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- free [GitHub](https://github.com) and [Slack](https://slack.com) accounts
- a free [Fermyon Cloud](https://cloud.fermyon.com) accountWhen running or deploying, you need to set the [Slack webhook URL](https://api.slack.com/messaging/webhooks)
and the [GitHub payload secret](https://docs.github.com/en/webhooks-and-events/webhooks/securing-your-webhooks)
as configuration variables. See `spin.toml` and [the documentation for config](https://developer.fermyon.com/cloud/variables).```bash
$ npm install
$ spin build
spin deploy --variable payload_secret=$PAYLOAD_SECRET --variable slack_webhook_url=$SLACK_WEBHOOK_URL
Uploading github-stars-webhook version 0.1.0+r6ed768d9...
Deploying...
Waiting for application to become ready...... ready
Available Routes:
github-star-webhook: https://github-stars-webhook-.fermyon.app (wildcard)
```[Create a GitHub webhook for the `star created or deleted` event](https://docs.github.com/en/developers/webhooks-and-events/webhooks/creating-webhooks)
using the URL returned by the `spin deploy` command.
Then, on every star event, the application will send a message to your
configured Slack channel: