11name : ES|QL Validation
22on :
33 push :
4- branches : [ "main", "7.*", " 8.*", "9.*" ]
4+ branches : [ "main", "8.*", "9.*" ]
55 pull_request :
66 branches : [ "*" ]
77 paths :
@@ -12,12 +12,14 @@ jobs:
1212
1313 steps :
1414 - name : Check out repository
15- uses : actions/checkout@v4
15+ if : ${{ !env.cloud_id && !env.api_key }}
16+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
1617 with :
1718 path : elastic-container
1819 repository : eric-forte-elastic/elastic-container
1920
2021 - name : Build and run containers
22+ if : ${{ !env.cloud_id && !env.api_key }}
2123 run : |
2224 cd elastic-container
2325 GENERATED_PASSWORD=$(openssl rand -base64 16)
@@ -28,16 +30,17 @@ jobs:
2830
2931
3032 - name : Setup Detection Rules
31- uses : actions/checkout@v4
33+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
3234 with :
3335 fetch-depth : 0
3436
3537 - name : Set up Python 3.13
36- uses : actions/setup-python@v5
38+ uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
3739 with :
3840 python-version : ' 3.13'
3941
4042 - name : Get API Key and setup auth
43+ if : ${{ !env.cloud_id && !env.api_key }}
4144 env :
4245 DR_ELASTICSEARCH_URL : " https://localhost:9200"
4346 ES_USER : " elastic"
6164
6265 - name : Validate Test ESQL Rule
6366 env :
64- DR_KIBANA_URL : " https://localhost:5601"
65- DR_ES_USER : " elastic"
66- DR_API_KEY : ${{ env.DR_API_KEY }}
67+ DR_CLOUD_ID : ${{ env.cloud_id }}
68+ DR_KIBANA_URL : ${{ env.cloud_id == '' && 'https://localhost:5601' || '' }}
69+ DR_ES_USER : ${{ env.cloud_id == '' && 'elastic' || '' }}
70+ DR_API_KEY : ${{ env.api_key || env.DR_API_KEY }}
6771 run : |
6872 cd detection-rules
6973 python -m pytest tests/test_rules_remote.py::TestRemoteRules::test_esql_rules
0 commit comments