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

feat: add requirements_file input to GitHub action #4253

Merged
merged 2 commits into from
Jul 18, 2024
Merged
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
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ inputs:
description: The directory where to run ansible-lint from. Default is `github.workspace`.
required: false
default: ""
requirements_file:
description: Path to the requirements YAML file to install role and collection dependencies.
required: false
default: ""
runs:
using: composite
steps:
Expand Down Expand Up @@ -65,6 +69,12 @@ runs:
pip install "ansible-lint[lock] @ git+https://github.com/ansible/ansible-lint@$GH_ACTION_REF"
ansible-lint --version

- name: Install role and collection dependencies from requirements file
if: inputs.requirements_file != ''
shell: bash
working-directory: ${{ steps.inputs.outputs.working_directory }}
run: ansible-galaxy install -r ${{ inputs.requirements_file }}

- name: Run ansible-lint
shell: bash
working-directory: ${{ steps.inputs.outputs.working_directory }}
Expand Down
Loading