Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for --disable-pip #53

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,23 @@ Example
PYSEC-AAAA-BBBBB
```

### `disable-pip`

**Default**: `false`

The `disable-pip` setting disable the use of `pip` for dependency resolution. This can only be used with
hashed requirements files or if the `no-deps` setting has been provided.

Example

```yaml
- uses: pypa/gh-action-pip-audit@v1.1.0
with:
inputs: requirements.lock
disable-pip: true
no-deps: true
```

### Internal options
<details>
<summary>⚠️ Internal options ⚠️</summary>
Expand Down
3 changes: 3 additions & 0 deletions action.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def _fatal_help(msg):
if os.getenv("GHA_PIP_AUDIT_LOCAL", "false") != "false":
pip_audit_args.append("--local")

if os.getenv("GHA_PIP_DISABLE_PIP", "false") != "false":
pip_audit_args.append("--disable-pip")

index_url = os.getenv("GHA_PIP_AUDIT_INDEX_URL")
if index_url != "":
pip_audit_args.extend(["--index-url", index_url])
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ inputs:
description: "vulnerabilities to explicitly exclude, if present (whitespace separated)"
required: false
default: ""
disable-pip:
description: "disable pip"
required: false
default: false
internal-be-careful-allow-failure:
description: "don't fail the job if the audit fails (default false)"
required: false
Expand Down Expand Up @@ -82,6 +86,7 @@ runs:
GHA_PIP_AUDIT_INDEX_URL: "${{ inputs.index-url }}"
GHA_PIP_AUDIT_EXTRA_INDEX_URLS: "${{ inputs.extra-index-urls }}"
GHA_PIP_AUDIT_IGNORE_VULNS: "${{ inputs.ignore-vulns }}"
GHA_PIP_DISABLE_PIP: "${{ inputs.disable-pip }}"
GHA_PIP_AUDIT_INTERNAL_BE_CAREFUL_ALLOW_FAILURE: "${{ inputs.internal-be-careful-allow-failure }}"
GHA_PIP_AUDIT_INTERNAL_BE_CAREFUL_EXTRA_FLAGS: "${{ inputs.internal-be-careful-extra-flags }}"
shell: bash
Loading