From 9eb6e06884211669183b15e0d5e6f0bb0dc5ab61 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Tue, 11 Feb 2025 19:36:18 +1030 Subject: [PATCH 1/2] ci: pip-audit pre-commit git hook --- .pre-commit-config.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8bea68f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: + # https://github.com/pypa/pip-audit?tab=readme-ov-file#pre-commit-support + - repo: https://github.com/pypa/pip-audit + rev: v2.8.0 + hooks: + - id: pip-audit + args: ["-r", "requirements.txt"] + +ci: + # Leave pip-audit to only run locally and not in CI + # pre-commit.ci does not allow network calls + skip: [pip-audit] + \ No newline at end of file From 8f2a7851a07a9c680f32567005c88b7983914d29 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Tue, 11 Feb 2025 20:27:45 +1030 Subject: [PATCH 2/2] ci: pip-audit GitHub Action --- .github/workflows/pypa-pip-audit.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/pypa-pip-audit.yml diff --git a/.github/workflows/pypa-pip-audit.yml b/.github/workflows/pypa-pip-audit.yml new file mode 100644 index 0000000..f1f6357 --- /dev/null +++ b/.github/workflows/pypa-pip-audit.yml @@ -0,0 +1,25 @@ +# https://github.com/pypa/gh-action-pip-a +name: 'PyPA pip-audit' + +on: + pull_request: + branches: + - master + push: + branches: + - master + + +jobs: + selftest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: install + run: | + python -m venv env/ + source env/bin/activate + python -m pip install . + - uses: pypa/gh-action-pip-audit@v1.1.0 + with: + virtual-environment: env/