Skip to content

Commit e528feb

Browse files
authored
chore(ci): new CI action trigger for REACT testing workflow (#4435)
* 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.
1 parent b13d6bf commit e528feb

File tree

2 files changed

+23
-27
lines changed

2 files changed

+23
-27
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: REACT Tests Dispatcher
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'rules/**/*.toml'
7+
8+
jobs:
9+
dispatch:
10+
name: Run REACT tests
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Trigger REACT workflow
14+
env:
15+
REACT_WORKFLOW_ID: "detection-rules-tests.yml"
16+
run: |
17+
curl -X POST \
18+
-H "Accept: application/vnd.github.everest-preview+json" \
19+
-H "Content-Type: application/json" \
20+
-H "Authorization: token ${{ secrets.WRITE_DETECTION_RULES_REACT_TOKEN }}" \
21+
"https://api.github.com/repos/elastic/react/actions/workflows/$REACT_WORKFLOW_ID/dispatches" \
22+
-d '{"ref": "main", "inputs": {"pr_branch": "${{ github.head_ref || github.ref_name }}", "pr_id": "${{ github.event.number }}"}}'
23+
exit $?

.github/workflows/trigger-react.yml

-27
This file was deleted.

0 commit comments

Comments
 (0)