GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - actionsflow/webhook2github: Forward webhook to github repository_dispatch event

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
test
test
 
 
types
types
 
 
.cargo-ok
.cargo-ok
 
 
.gitignore
.gitignore
 
 
.prettierrc
.prettierrc
 
 
.release-it.json
.release-it.json
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE_APACHE
LICENSE_APACHE
 
 
LICENSE_MIT
LICENSE_MIT
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
webpack.config.js
webpack.config.js
 
 
wrangler.toml
wrangler.toml
 
 

Repository files navigation

webhook2github

This API enables forward webhook requests to github repository_dispatch event webhook.

API Endpoint: https://webhook.actionsflow.workers.dev/

Usage

https://webhook.actionsflow.workers.dev/<owner>/<repo>/<your-path>?__token=<your-github-personal-token>

The default response of the webhook will use the github create-a-repository-dispatch-event API response. You can use search params __response_code, __response_content_type, __response_body to specify a custom response.

You can also use headers X-Github-Authorization instead of search params __token for more security.

The webhook also supports the cross-origin resource sharing request.

For example:

curl --request POST 'https://webhook.actionsflow.workers.dev/actionsflow/webhook2github/webhook/webhook?__token=<your-github-personal-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "key": "value"
}'

Specify response code example:

curl --request POST 'https://webhook.actionsflow.workers.dev/actionsflow/webhook2github/webhook/webhook?__token=<your-github-personal-token>&__response_code=200' \
--header 'Content-Type: application/json' \
--data-raw '{
    "key": "value"
}'

An axios example:

var axios = require('axios')
var data = JSON.stringify({ key: 'value' })

var config = {
  method: 'post',
  url:
    'https://webhook.actionsflow.workers.dev/actionsflow/webhook2github/webhook/webhook?__token=<your-github-personal-token>',

  data: data,
}

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data))
  })
  .catch(function (error) {
    console.log(error)
  })

How It Works

This API will forward the following original webhook request:

https://webhook.actionsflow.workers.dev/<owner>/<repo>/<your-path>?__token=<your-github-personal-token>

To https://api.github.com/repos/<owner>/<repo>/dispatches, with body:

{
  "event_type": "webhook",
  "client_payload": {
    "path": "<your-path>",
    "method": "<request.method>",
    "headers": "<request.headers>",
    "body": "<request body>"
  }
}

So Github actions will be triggered with repository_dispatch event.

About

Forward webhook to github repository_dispatch event

Topics

githubwebhookworkflows

Resources

Readme

Contributing

Contributing
Activity
Custom properties

Stars

12 stars

Watchers

0 watching

Forks

3 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.