Skip to content

Commit

Permalink
feat(action): add sample github action config
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwa committed May 13, 2021
1 parent 1e9d9a5 commit 1884a81
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/sample.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# see https://docs.github.com/en/actions
name: example receiver repo hook

# Use repository_dispatch event to manually trigger github actions
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
# Triggers the workflow on repository_dispatch request events
# https://docs.github.com/en/rest/reference/repos#create-a-repository-dispatch-event
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
repository_dispatch:
# parameter `event_type` field
types: [example-event-type]
# Triggers the workflow on push or pull request events but only for the main branch
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "dispatch"
dispatch:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.5
with:
# Set always-auth in npmrc
always-auth: false # optional, default is false
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
node-version: 15.x

# Retrieve event payload
- name: Retrieve the `client_payload` value from repository_dispatch event
run: |
echo "Event payload: ${{ github.event.client_payload }}"

0 comments on commit 1884a81

Please sign in to comment.