Skip to content
14 changes: 14 additions & 0 deletions .github/workflows/conditional.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: example-workflow
on: [push]
jobs:
hello-world:
if: github.repository == 'Agnesakpa/Github-Examples'
runs-on: ubuntu-latest
steps:
- name: "Hello World"
run: echo "Hello World!"
goodbye-moon:
runs-on: ubuntu-latest
steps:
- name: "Goodbye Moon"
run: echo "Goodbye Moon!"
15 changes: 0 additions & 15 deletions .github/workflows/custom-action.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Webhook Event example"

on:
repository_dispatch:
types:
- webhook

jobs:
respond-to-dispatch:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Run a script
run: 'echo "Event of type: $GITHUB_EVENT_NAME"'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Github-Examples
A repo containing GitHub for programmatic examples

4 changes: 2 additions & 2 deletions github-actions/Readme.me
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo '{"name":"mona", "greeting":"hello"}' | gh workflow run greet.yml --json
```sh
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token {PAT} \
-H "Authorization: token "" \
-d '{"event_type": "webhook", "client_payload": {"key": "value"} }' \
https://api.github.com/repos/{owner}/{repo}/dispatches
https://api.github.com/repos/Agnesakpa/Github-Examples/dispatches
```