Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
650c3a82c3 | ||
|
|
337625dcf3
|
||
|
|
4200498273
|
||
|
|
9b121ebd3a
|
No files matched your search
@@ -2,35 +2,78 @@ name: Lint & Security
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
precommit-and-security:
|
||||
name: lint-and-security
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Install pre-commit
|
||||
run: pip install pre-commit
|
||||
- name: Install Poetry
|
||||
run: pip install "poetry>=2,<3"
|
||||
|
||||
- name: Install dev dependencies (lockfile-pinned pre-commit)
|
||||
run: poetry install --with dev --no-root
|
||||
|
||||
- name: Run pre-commit hooks
|
||||
run: pre-commit run --all-files --color always
|
||||
|
||||
- name: Install Poetry
|
||||
run: |
|
||||
pip install "poetry>=2,<3"
|
||||
poetry self add poetry-plugin-export
|
||||
run: poetry run pre-commit run --all-files --color always
|
||||
|
||||
- name: Install pip-audit
|
||||
run: pip install pip-audit
|
||||
run: pip install "pip-audit==2.10.1"
|
||||
|
||||
- name: Audit dependencies (Poetry lockfile)
|
||||
run: |
|
||||
poetry export -f requirements.txt --without-hashes \
|
||||
| pip-audit -r /dev/stdin
|
||||
set -euo pipefail
|
||||
|
||||
poetry self add poetry-plugin-export
|
||||
poetry export -f requirements.txt --without-hashes -o requirements-audit.txt
|
||||
|
||||
# pip-audit exits non-zero for ANY vulnerability; capture the report, then gate below.
|
||||
pip-audit --no-deps -r requirements-audit.txt -f json -o pip-audit.json || true
|
||||
|
||||
echo "Fixable vulnerabilities:"
|
||||
jq -r '
|
||||
.dependencies[]?
|
||||
| select(has("vulns"))
|
||||
| . as $d
|
||||
| .vulns[]
|
||||
| select((.fix_versions | length) > 0)
|
||||
| "\($d.name)@\($d.version) -> \(.id) [fix: \(.fix_versions | join(", "))]"
|
||||
' pip-audit.json
|
||||
|
||||
echo
|
||||
echo "All reported vulnerabilities:"
|
||||
jq -r '
|
||||
.dependencies[]?
|
||||
| select(has("vulns"))
|
||||
| . as $d
|
||||
| .vulns[]
|
||||
| "\($d.name)@\($d.version) -> \(.id) [fix: \(if (.fix_versions | length) > 0 then (.fix_versions | join(", ")) else "none" end)]"
|
||||
' pip-audit.json
|
||||
|
||||
# Fail only on fixable findings (mirrors the Grype policy in security-scan.yml).
|
||||
# The type guard ensures a crashed/empty report fails rather than silently passing.
|
||||
jq -e '
|
||||
(.dependencies | type) == "array"
|
||||
and
|
||||
( [ .dependencies[] | (.vulns // [])[] | select((.fix_versions | length) > 0) ] | length == 0 )
|
||||
' pip-audit.json
|
||||
@@ -0,0 +1 @@
|
||||
* @mdaleo404
|
||||
@@ -0,0 +1,2 @@
|
||||
github: mdaleo404
|
||||
ko_fi: mdaleo404
|
||||
@@ -0,0 +1,79 @@
|
||||
name: Lint & Security
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
precommit-and-security:
|
||||
name: lint-and-security
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Install Poetry
|
||||
run: pip install "poetry>=2,<3"
|
||||
|
||||
- name: Install dev dependencies (lockfile-pinned pre-commit)
|
||||
run: poetry install --with dev --no-root
|
||||
|
||||
- name: Run pre-commit hooks
|
||||
run: poetry run pre-commit run --all-files --color always
|
||||
|
||||
- name: Install pip-audit
|
||||
run: pip install "pip-audit==2.10.1"
|
||||
|
||||
- name: Audit dependencies (Poetry lockfile)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
poetry self add poetry-plugin-export
|
||||
poetry export -f requirements.txt --without-hashes -o requirements-audit.txt
|
||||
|
||||
# pip-audit exits non-zero for ANY vulnerability; capture the report, then gate below.
|
||||
pip-audit --no-deps -r requirements-audit.txt -f json -o pip-audit.json || true
|
||||
|
||||
echo "Fixable vulnerabilities:"
|
||||
jq -r '
|
||||
.dependencies[]?
|
||||
| select(has("vulns"))
|
||||
| . as $d
|
||||
| .vulns[]
|
||||
| select((.fix_versions | length) > 0)
|
||||
| "\($d.name)@\($d.version) -> \(.id) [fix: \(.fix_versions | join(", "))]"
|
||||
' pip-audit.json
|
||||
|
||||
echo
|
||||
echo "All reported vulnerabilities:"
|
||||
jq -r '
|
||||
.dependencies[]?
|
||||
| select(has("vulns"))
|
||||
| . as $d
|
||||
| .vulns[]
|
||||
| "\($d.name)@\($d.version) -> \(.id) [fix: \(if (.fix_versions | length) > 0 then (.fix_versions | join(", ")) else "none" end)]"
|
||||
' pip-audit.json
|
||||
|
||||
# Fail only on fixable findings (mirrors the Grype policy in security-scan.yml).
|
||||
# The type guard ensures a crashed/empty report fails rather than silently passing.
|
||||
jq -e '
|
||||
(.dependencies | type) == "array"
|
||||
and
|
||||
( [ .dependencies[] | (.vulns // [])[] | select((.fix_versions | length) > 0) ] | length == 0 )
|
||||
' pip-audit.json
|
||||
Generated
+2
-16
@@ -224,19 +224,6 @@ files = [
|
||||
{file = "pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.15.0"
|
||||
description = "Backported and Experimental Type Hints for Python 3.9+"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
markers = "python_version == \"3.10\""
|
||||
files = [
|
||||
{file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"},
|
||||
{file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "virtualenv"
|
||||
version = "21.14.2"
|
||||
@@ -255,9 +242,8 @@ filelock = {version = ">=3.24.2,<5", markers = "python_version >= \"3.10\""}
|
||||
packaging = ">=23.1"
|
||||
platformdirs = ">=3.9.1,<5"
|
||||
python-discovery = ">=1.6"
|
||||
typing-extensions = {version = ">=4.13.2", markers = "python_version < \"3.11\""}
|
||||
|
||||
[metadata]
|
||||
lock-version = "2.1"
|
||||
python-versions = ">=3.10,<4.0"
|
||||
content-hash = "48203cd9c9c4027b78f2f8ee405683b62aeda2cdeb1ec84bba0f193b80ad12b9"
|
||||
python-versions = ">=3.11,<4.0"
|
||||
content-hash = "0f02d476d4b4963c6f63ff5cce3eafd047bc5fb46d55ca79d3bac67513789da0"
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
[project]
|
||||
name = "resrm"
|
||||
version = "0.4.2"
|
||||
version = "0.5.0"
|
||||
description = "drop-in replacement for rm with undo/restore built-in."
|
||||
authors = [{ name = "Marco D'Aleo", email = "marco@marcodaleo.com" }]
|
||||
license = "GPL-3.0-or-later"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10,<4.0"
|
||||
requires-python = ">=3.11,<4.0"
|
||||
dependencies = [
|
||||
"argcomplete>=2",
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user