Coder Social home page Coder Social logo

lgtm-migrator / trigger-repository-dispatch-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from myrotvorets/trigger-repository-dispatch-action

0.0 0.0 0.0 718 KB

GitHub action to trigger a repository_dispatch event

License: MIT License

TypeScript 100.00%

trigger-repository-dispatch-action's Introduction

Trigger repository_dispatch Action

Triggers a repository_dispatch event for the given repository.

Inputs

Name Default Required? Description
token YES A Personal Access Token with repo scope
repo github.repository No The name of the repository to send the event (owner/repo)
type YES A custom webhook event name
payload No JSON payload with extra information about the webhook event that your action or workflow may use. GitHub API allows for a maximum of 10 top-level properties

Example usage

In the workflow that needs to trigger a repository_dispatch action:

      - name: Repository Dispatch
        uses: myrotvorets/[email protected]
        with:
          token: ${{ secrets.REPOSITORY_ACCESS_TOKEN }}
          repo: username/my-repo
          type: my-custom-event
          payload: '{ "ref": "${{ github.ref }}", "sha": "${{ github.sha }}" }'

A workflow that handles repository_dispatch action:

name: Repository Dispatch
on:
  repository_dispatch:
    types:
      - my-custom-event
jobs:
  handle-dispatch:
    runs-on: ubuntu-latest
    steps:
      - name: Print commit hash
        run: echo ${{ github.event.client_payload.sha }}

      - name: Checkout
        uses: actions/checkout@v2
        with:
          ref: ${{ github.event.client_payload.ref }}

trigger-repository-dispatch-action's People

Contributors

myrotvorets-team avatar renovate[bot] avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.