e528feb989
* 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 6c18c5b8b39702cd4106c7b46b8534c76c4c9c27.
24 lines
798 B
YAML
24 lines
798 B
YAML
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 $?
|