diff --git a/README.md b/README.md index a91964a7..8dc6d08f 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ See examples of using `cache` and `cache-dependency-path` for `pipenv` and `poet - [Using `setup-python` with a self-hosted runner](docs/advanced-usage.md#using-setup-python-with-a-self-hosted-runner) - [Using `setup-python` on GHES](docs/advanced-usage.md#using-setup-python-on-ghes) - [Allow pre-releases](docs/advanced-usage.md#allow-pre-releases) +- [Using the pip-version input](docs/advanced-usage.md#using-the-pip-version-input) ## Recommended permissions diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 72b35016..7a8f1187 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -22,6 +22,7 @@ - [macOS](advanced-usage.md#macos) - [Using `setup-python` on GHES](advanced-usage.md#using-setup-python-on-ghes) - [Allow pre-releases](advanced-usage.md#allow-pre-releases) +- [Using the pip-version input](advanced-usage.md#using-the-pip-version-input) ## Using the `python-version` input @@ -643,3 +644,22 @@ jobs: - run: pipx run nox --error-on-missing-interpreters -s tests-${{ matrix.python_version }} ``` +## Using the pip-version input + +The `pip-version` input allows you to specify the desired version of **Pip** to use with the standard Python version. +The version of Pip should be specified in the format `major`, `major.minor`, or `major.minor.patch` (for example: 25, 25.1, or 25.0.1). + +```yaml + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + pip-version: '25.0.1' + - name: Display Pip version + run: pip --version +``` +> The `pip-version` input is supported only with standard Python versions. It is not available when using PyPy or GraalPy. + +> Using a specific or outdated version of pip may result in compatibility or security issues and can cause job failures. For best practices and guidance, refer to the official [pip documentation](https://pip.pypa.io/en/stable/). \ No newline at end of file