Skip to content

Commit

Permalink
event_typeで発火するrepository_dispatch対象を分ける
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-chan committed May 21, 2021
1 parent 2428c87 commit 996d8dc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: nightly

on:
# push:
# repository_dispatch:
repository_dispatch:
types: [nightly_trigger]
schedule:
- cron: "0 15 * * *"

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: stable
on:
# push:
repository_dispatch:
types: [stable_trigger]
schedule:
- cron: "0 16 * * *"

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
secret.sh
15 changes: 10 additions & 5 deletions call.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/$GITHUB_REPOSITORY/dispatches \
--data '{"event_type":"test_trigger"}'
# stable_trigger
# nightly_trigger
event_type=${1:-nightly_trigger}

curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/$GITHUB_REPOSITORY/dispatches \
--data "{\"event_type\":\"${event_type}\"}"

0 comments on commit 996d8dc

Please sign in to comment.