Skip to content

update(query): add CWE information to volume_has_sensitive_host_directory #3294

update(query): add CWE information to volume_has_sensitive_host_directory

update(query): add CWE information to volume_has_sensitive_host_directory #3294

name: check-go-coverage
on:
pull_request:
branches: [master]
jobs:
coverage:
name: generate-coverage
runs-on: ubuntu-latest
outputs:
coverage: ${{ steps.testcov.outputs.coverage }}
color: ${{ steps.testcov.outputs.color }}
steps:
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run test metrics script
id: testcov
run: |
make test-coverage-report | tee test-results
TOTAL_TESTS=$(cat test-results | grep -v TestQueriesContent/ | grep -v TestQueriesMetadata/ | grep -v TestQueries/ | grep PASS | wc -l)
echo "Total number of tests :: ${TOTAL_TESTS}"
echo "::set-output name=total_tests::${TOTAL_TESTS}"
- name: Checks if Go coverage is at least 74%
if: steps.testcov.outputs.coverage < 74
run: |
echo "Go coverage is lower than 74%: ${{ steps.testcov.outputs.coverage }}%"
exit 1