Skip to content

Commit 38f4830

Browse files
committed
internal: trigger terraform-google-secure job for PR
1 parent 4c7794d commit 38f4830

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/sanity-test.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Sanity Test Jenkins Trigger
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: main-${{ github.ref }}
11+
cancel-in-progress: false
12+
13+
jobs:
14+
sanity-tests:
15+
if: (github.event_name == 'pull_request' && github.event.action == 'ready_for_review') ||
16+
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
17+
runs-on: tools-runner
18+
19+
steps:
20+
- name: Check for skip sanity test label
21+
id: check-skip-sanity-test
22+
env:
23+
GH_TOKEN: ${{ github.token }}
24+
run: |
25+
gh api -H "Accept: application/vnd.github+json" /repos/sysdiglabs/terraform-google-secure/issues/${{ github.event.pull_request.number }}/labels | jq '[.[].name]' > /tmp/label_list
26+
if grep -q 'skip-sanity-test' /tmp/label_list; then
27+
echo "Skipping terraform-google-secure-onboarding-tests job as skip-sanity-test label is present"
28+
echo "SKIP_SANITY_TEST=true" >> $GITHUB_OUTPUT
29+
else
30+
echo "SKIP_SANITY_TEST=false" >> $GITHUB_OUTPUT
31+
fi
32+
33+
- name: Trigger Onboarding job for this repo
34+
if: ${{ steps.check-skip-sanity-test.outputs.SKIP_SANITY_TEST == 'false'}}
35+
id: trigger-jenkins-job
36+
uses: draios/[email protected]
37+
with:
38+
jenkins_url: ${{ secrets.JENKINS_INTERNAL_URL }}
39+
jenkins_user: ${{ secrets.JENKINS_QA_API_USER }}
40+
jenkins_token: ${{ secrets.JENKINS_QA_API_TOKEN }}
41+
job_name: "qa/QA-secure/onboarding/terraform-google-secure-onboarding-tests/"
42+
job_params: |
43+
{
44+
"MODULE_BRANCH": "${{ github.head_ref }}"
45+
}
46+
job_timeout: "5400"

0 commit comments

Comments
 (0)