josa42 / gh-action-webhook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Github Action: Webhook

Github Action

A Github Action to trigger a http request.

Input Parameters

Key Required Default Description
url Yes Request URL.
method No POST GET, POST, PUT or DELETE
data No Request Body.
authorization No Set Authorization header.
accept No Set Accept header.
content_type No Set Content-Type header.

Usage

- uses: 'josa42/gh-action-webhook/release@master'
  with:
    url:           'http://httpbin.org/post'
    authorization: 'Bearer ${{ secrets.TOKEN }}'
    data:          '{ "data": "TEST" }'

You can choose one of these versions:

  • Latest Release: josa42/gh-action-webhook/release@master
  • Latest Build josa42/gh-action-webhook/latest@master
  • A specific Release: josa42/gh-action-webhook/release@0.1.0
  • A specific commit: josa42/gh-action-webhook/build@54e5a00
    (This will be slow since, the workflow needs to be build on every run)

Examples

Post a Slack Message

name: 'New Tag'
on:
  tag: [ '*' ]
jobs:
  test:
    name:    'Publish master'
    runs-on: 'ubuntu-latest'
    steps:
      - uses: 'josa42/gh-action-webhook/latest@master'
        with:
          url:  'https://hooks.slack.com/services/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'
          data: '{ "text": "New Tag: ${{github.ref}}!" }'

See Slack Documentation for more infos.

Rebuild Github Page

name: 'Schedule'
on:
  schedule:
    - cron: '*/15 * * * *'
jobs:
  test:
    name:    'Publish master'
    runs-on: 'ubuntu-latest'
    steps:
      - uses: 'josa42/gh-action-webhook/latest@master'
        with:
          url:           'https://api.github.com/repos/josa42/josa42.github.io/pages/builds'
          authorization: 'Token ${{ secrets.GITHUB_TOKEN }}'
          accept:        'application/vnd.github.mister-fantastic-preview+json'

License

MIT © Josa Gesell

About

License:MIT License


Languages

Language:Go 73.7%Language:Dockerfile 21.5%Language:Shell 4.7%