From 4aa85fcf683504f838adffe1a58fcd76cb9bd9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Wed, 29 Oct 2025 17:05:06 +0000 Subject: [PATCH] add python_version support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- README.md | 2 ++ action.yml | 6 +++++- docs/installing.md | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b4ae868782..a2c5a5a1a7 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ jobs: args: "" gh_action_ref: "" # Not recommended for non-composite action use setup_python: "true" + python_version: "3.14" working_directory: "" requirements_file: "" ``` @@ -50,6 +51,7 @@ All the arguments are optional: - `requirements_file`: Path to the requirements.yml file to install role and collection dependencies. - `setup_python`: If python should be installed. Default is `true`. +- `python_version`: The version of python to install. Default is `3.14`. - `working_directory`: The directory where to run ansible-lint from. Default is `github.workspace`. Needed if you want to lint only a subset of your repository. diff --git a/action.yml b/action.yml index 5d27159489..9e1aed1257 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,10 @@ inputs: description: If false, this action will not setup python and will instead rely on the already installed python. required: false default: "true" + python_version: + description: The version of Python to use when setting up Python environment. Default is 3.14. + required: false + default: "3.14" working_directory: description: The directory where to run ansible-lint from. Default is `github.workspace`. required: false @@ -81,7 +85,7 @@ runs: with: cache: pip cache-dependency-path: ${{ steps.get_reqs.outputs.reqs_file }} - python-version: "3.14" + python-version: ${{ inputs.python_version }} - name: Install ansible-lint shell: bash diff --git a/docs/installing.md b/docs/installing.md index f552ebeb8b..b6df965952 100644 --- a/docs/installing.md +++ b/docs/installing.md @@ -120,6 +120,7 @@ jobs: with: args: "" setup_python: "true" + python_version: "3.14" working_directory: "" requirements_file: "" ``` @@ -128,6 +129,7 @@ All the arguments are optional and most users should not need them: - `args`: Arguments to be passed to ansible-lint command. - `setup_python`: If python should be installed. Default is `true`. +- `python_version`: Python version to be installed. Default is `3.14`. - `working_directory`: The directory where to run ansible-lint from. Default is `github.workspace`. That might be needed if you want to lint only a subset of your repository.