From 2a15a652c37ad939465acc20a2927b7487e83ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Wed, 17 Jun 2020 16:19:42 +0200 Subject: [PATCH 1/4] Trigger deploy of whatwg.org on changes Fixes https://github.com/whatwg/sg/issues/110. --- .github/workflows/dispatch.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/dispatch.yml diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml new file mode 100644 index 0000000..4fcdb1d --- /dev/null +++ b/.github/workflows/dispatch.yml @@ -0,0 +1,16 @@ +# This triggers the Build workflow in whatwg/whatwg.org for changes here. +name: Dispatch +on: + push: + branches: + - master +jobs: + dispatch: + name: Dispatch + runs-on: ubuntu-20.04 + steps: + - uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.DISPATCH_TOKEN }} + repository: whatwg/whatwg.org + event-type: sg_repo_updated From ec892d4d8a35fa43a0bebe282396dd0fd2d4b47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Wed, 17 Jun 2020 17:27:38 +0200 Subject: [PATCH 2/4] Use curl to poke the endpoint directly --- .github/workflows/dispatch.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml index 4fcdb1d..7054815 100644 --- a/.github/workflows/dispatch.yml +++ b/.github/workflows/dispatch.yml @@ -1,4 +1,5 @@ # This triggers the Build workflow in whatwg/whatwg.org for changes here. +# https://developer.github.com/v3/repos/#create-a-repository-dispatch-event name: Dispatch on: push: @@ -9,8 +10,4 @@ jobs: name: Dispatch runs-on: ubuntu-20.04 steps: - - uses: peter-evans/repository-dispatch@v1 - with: - token: ${{ secrets.DISPATCH_TOKEN }} - repository: whatwg/whatwg.org - event-type: sg_repo_updated + - run: curl --retry 2 --fail -X POST -H "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" -d '{"event_type":"sg_repo_updated"}' https://api.github.com/repos/whatwg/whatwg.org/dispatches From 2a4025d3d3558f7d8623a4cfc89f8fdd2d7c5ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Wed, 17 Jun 2020 17:31:11 +0200 Subject: [PATCH 3/4] Make it valid YAML --- .github/workflows/dispatch.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml index 7054815..322ce43 100644 --- a/.github/workflows/dispatch.yml +++ b/.github/workflows/dispatch.yml @@ -10,4 +10,8 @@ jobs: name: Dispatch runs-on: ubuntu-20.04 steps: - - run: curl --retry 2 --fail -X POST -H "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" -d '{"event_type":"sg_repo_updated"}' https://api.github.com/repos/whatwg/whatwg.org/dispatches + - run: | + curl --retry 2 --fail -X POST \ + -H "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" + -d '{"event_type":"sg_repo_updated"}' + https://api.github.com/repos/whatwg/whatwg.org/dispatches From a0d6da85178af9d927a8e73cadf6810c4498d8ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Wed, 17 Jun 2020 17:32:31 +0200 Subject: [PATCH 4/4] Backslash! --- .github/workflows/dispatch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml index 322ce43..ae553ee 100644 --- a/.github/workflows/dispatch.yml +++ b/.github/workflows/dispatch.yml @@ -12,6 +12,6 @@ jobs: steps: - run: | curl --retry 2 --fail -X POST \ - -H "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" - -d '{"event_type":"sg_repo_updated"}' + -H "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" \ + -d '{"event_type":"sg_repo_updated"}' \ https://api.github.com/repos/whatwg/whatwg.org/dispatches