feat: Added CI-PRE-CHECKER for VENDOR_PRODUCT #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Checkers-Action | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'cve_bin_tool/checkers/**/*.py' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- 'cve_bin_tool/checkers/**/*.py' | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Get date | |
id: get-date | |
run: | | |
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT | |
echo "yesterday=$(/bin/date -d "-1 day" -u "+%Y%m%d")" >> $GITHUB_OUTPUT | |
- name: Print Cache Keys | |
run: | | |
echo "Today's Cache Key: Linux-cve-bin-tool-${{ steps.get-date.outputs.date }}" | |
echo "Yesterday's Cache Key: Linux-cve-bin-tool-${{ steps.get-date.outputs.yesterday }}" | |
- name: Get today's cached database | |
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
id: todays-cache | |
with: | |
path: cache | |
key: Linux-cve-bin-tool-${{ steps.get-date.outputs.date }} | |
- name: Get yesterday's cached database if today's is not available | |
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
if: steps.todays-cache.outputs.cache-hit != 'true' | |
with: | |
path: cache | |
key: Linux-cve-bin-tool-${{ steps.get-date.outputs.yesterday }} | |
- name: Install cve-bin-tool | |
if: env.sbom != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools | |
python -m pip install --upgrade wheel | |
python -m pip install --upgrade -r dev-requirements.txt | |
python -m pip install --upgrade . | |
- name: Try single CLI run of tool | |
if: env.sbom != 'true' | |
run: | | |
[[ -e cache ]] && mkdir -p .cache && mv cache ~/.cache/cve-bin-tool | |
NO_EXIT_CVE_NUM=1 python -m cve_bin_tool.cli test/assets/test-kerberos-5-1.15.1.out | |
cp -r ~/.cache/cve-bin-tool cache | |
- name: Get changed files | |
id: changed-files | |
uses: jitterbit/get-changed-files@v1 | |
- name: Run Python script | |
run: | | |
for file in ${{ steps.changed-files.outputs.added_modified }}; do | |
python cve_bin_tool/ci_pre_checker.py "$file" | |
done | |
shell: bash |