Skip to content

Commit

Permalink
codeql: Only purge python cache if CODEQL_PYTHON is set (#2888)
Browse files Browse the repository at this point in the history
The environment variable will point to the python installation
that installed dependencies if dependencies were installed.[0]

[0] https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning?learn=code_security_actions&learnProduct=code-security#analyzing-python-dependencies

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
  • Loading branch information
jvesely authored Jan 25, 2024
1 parent 3380105 commit f9705ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ jobs:
- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Cache cleanup
- name: Pip cache cleanup
shell: bash
# CODEQL_PYTHON is only defined if dependencies were installed [0]
# [0] https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning?learn=code_security_actions&learnProduct=code-security#analyzing-python-dependencies
if: ${{ env.CODEQL_PYTHON != '' }}
run: |
$CODEQL_PYTHON -m pip cache info
$CODEQL_PYTHON -m pip cache purge
Expand Down

0 comments on commit f9705ca

Please sign in to comment.