Skip to content

Commit

Permalink
chore(ci): new CI action trigger for REACT testing workflow (#4435)
Browse files Browse the repository at this point in the history
* React test trigger

* Delete outdated CI trigger

* Fixing a trigger event

* Dummy rule updates

* Fix workflow name

* Fix typo in curl command

* Use correct token

* Using full workflow filename with extension

* Simplified JSON in curl request

* Using a correct value for branch

* Use a correct ref for a workflow

* Fix for invalid field name in a dispatch data

* Simplify json body

* Revert "Dummy rule updates"

This reverts commit 6c18c5b.

(cherry picked from commit e528feb)
  • Loading branch information
traut authored and tradebot-elastic committed Feb 6, 2025
1 parent 81757e8 commit 871d9ae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/react-tests-dispatcher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: REACT Tests Dispatcher

on:
pull_request:
paths:
- 'rules/**/*.toml'

jobs:
dispatch:
name: Run REACT tests
runs-on: ubuntu-latest
steps:
- name: Trigger REACT workflow
env:
REACT_WORKFLOW_ID: "detection-rules-tests.yml"
run: |
curl -X POST \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
-H "Authorization: token ${{ secrets.WRITE_DETECTION_RULES_REACT_TOKEN }}" \
"https://api.github.com/repos/elastic/react/actions/workflows/$REACT_WORKFLOW_ID/dispatches" \
-d '{"ref": "main", "inputs": {"pr_branch": "${{ github.head_ref || github.ref_name }}", "pr_id": "${{ github.event.number }}"}}'
exit $?
27 changes: 0 additions & 27 deletions .github/workflows/trigger-react.yml

This file was deleted.

0 comments on commit 871d9ae

Please sign in to comment.