From c443aadbe1244046a4c59ea9cd2ae6354b4e5c1b Mon Sep 17 00:00:00 2001 From: Mika Ayenson Date: Thu, 4 May 2023 16:44:28 -0400 Subject: [PATCH] [FR] Add base pipeline to trigger react (#2768) --- .github/workflows/trigger-react.yml | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/trigger-react.yml diff --git a/.github/workflows/trigger-react.yml b/.github/workflows/trigger-react.yml new file mode 100644 index 000000000..d695afd71 --- /dev/null +++ b/.github/workflows/trigger-react.yml @@ -0,0 +1,31 @@ +name: Trigger REACT Buildkite Pipeline + +on: + push: + branches: [ "main", "7.*", "8.*" ] + paths: + - 'rules/**/*.toml' + pull_request: + branches: [ "*" ] + paths: + - 'rules/**/*.toml' + +jobs: + trigger_buildkite: + runs-on: ubuntu-latest + steps: + - name: Trigger a Buildkite REACT Build + run: | + curl -X POST "https://api.buildkite.com/v2/organizations/elastic/pipelines/react/builds" \ + -H "Authorization: Bearer ${{ secrets.REACT_BUILDKITE_API_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d '{ + "commit": "HEAD", + "branch": "main", + "message": ":github: Triggered from a DR GitHub Action", + "env": { + "GITHUB_COMMIT_HASH": "${{ github.sha }}", + "GITHUB_HEAD_BRANCH": "${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}", + "GITHUB_SRC_BRANCH": "${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref_name }}" + } + }'