From 59e7a10732fe33c4f1b86e90eb2b9c7a61d16810 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Tue, 27 Jul 2021 13:02:21 -0500 Subject: [PATCH] Add dispatch --- .github/actions/dispatch.sh | 5 +++++ .github/workflows/build-reference.yml | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 .github/actions/dispatch.sh create mode 100644 .github/workflows/build-reference.yml diff --git a/.github/actions/dispatch.sh b/.github/actions/dispatch.sh new file mode 100755 index 0000000000..d6c2a37794 --- /dev/null +++ b/.github/actions/dispatch.sh @@ -0,0 +1,5 @@ +REPOSITORY_REF="$1" +TOKEN="$2" + +curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${TOKEN}" --request POST --data '{"event_type": "request-build"}' https://api.github.com/repos/${REPOSITORY_REF}/dispatches +echo "Requested Build for $REPOSITORY_REF" \ No newline at end of file diff --git a/.github/workflows/build-reference.yml b/.github/workflows/build-reference.yml new file mode 100644 index 0000000000..3e3f714e06 --- /dev/null +++ b/.github/workflows/build-reference.yml @@ -0,0 +1,18 @@ +name: reference + +on: + push: + branches-ignore: + - 'gh-pages' + +env: + GH_TOKEN_DISPATCH: ${{ secrets.GH_TOKEN_DISPATCH }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Source + uses: actions/checkout@v2 + - name: Dispatch Build Request + run: ${GITHUB_WORKSPACE}/.github/actions/dispatch.sh 'rwinch/spring-reference' "$GH_TOKEN_DISPATCH" \ No newline at end of file