Skip to content

Commit 7482b33

Browse files
authored
fix sanity workflow (#84)
1 parent f44828c commit 7482b33

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

.github/workflows/sanity-test.yaml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,22 @@ concurrency:
1313
jobs:
1414
sanity-tests:
1515
if: (github.event_name == 'pull_request' && github.event.action == 'ready_for_review') ||
16-
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
16+
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved') ||
17+
(github.event_name == 'push' && github.ref == 'refs/heads/main')
1718
runs-on: tools-runner
1819

1920
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-
3321
- name: Trigger Onboarding job for this repo
34-
if: ${{ steps.check-skip-sanity-test.outputs.SKIP_SANITY_TEST == 'false'}}
3522
id: trigger-jenkins-job
3623
uses: sysdiglabs/[email protected]
3724
with:
3825
jenkins_external_base_url: ${{ secrets.JENKINS_EXTERNAL_BASE_URL }}
3926
jenkins_url: ${{ secrets.JENKINS_INTERNAL_URL }}
40-
jenkins_user: ${{ secrets.JENKINS_QA_API_USER }}
41-
jenkins_token: ${{ secrets.JENKINS_QA_API_TOKEN }}
42-
job_name: "qa/QA-secure/onboarding/terraform-google-secure-onboarding-tests/"
27+
jenkins_user: ${{ secrets.JENKINS_BOT_API_USER}}
28+
jenkins_token: ${{ secrets.JENKINS_BOT_API_TOKEN}}
29+
job_name: "qa/job/QA-secure/job/onboarding/job/terraform-google-secure-onboarding-tests/"
4330
job_params: |
4431
{
45-
"MODULE_BRANCH": "${{ github.head_ref }}"
32+
"MODULE_BRANCH": "${{ github.head_ref || github.ref_name }}"
4633
}
4734
job_timeout: "5400"

0 commit comments

Comments
 (0)