fix: remove the dependency file input

This commit is contained in:
Michael Sasser 2024-11-19 04:21:55 +01:00
parent 49f7723ca8
commit 695fc981d0
Signed by: michael
GPG key ID: 5F653AC7631F5151

View file

@ -8,10 +8,6 @@ branding:
color: blue
inputs:
requirements_file:
description: Path to the requirements file.
required: false
default: "${{ github.workspace }}/meta/requirements.yml"
args:
description: Arguments to be passed to ansible-lint command. Defaults to '--show-relpath'
required: false
@ -23,26 +19,26 @@ runs:
# Check if dependencies exist.
- name: Check if the role has dependencies
shell: bash
id: get-role-has-dependencies
id: get-role-dependencies
run: |
if test -f "${{ inputs.requirements_file }}"; then
echo 'The requirements file ${{ inputs.requirements_file }} exists'
echo '::set-output name=role_has_dependencies::true'
if test -f "${{ github.workspace }}/meta/requirements.yml"; then
echo "The role has dependencies"
echo '::set-output name=has_dependencies::true'
else
echo 'The requirements file ${{ inputs.requirements_file }} does not exist'
echo '::set-output name=role_has_dependencies::false'
echo "The role does not have dependencies"
echo '::set-output name=has_dependencies::false'
fi
# Run linter
- name: Run ansible-lint (with dependencies)
if: ${{ steps.get-role-has-dependencies.outputs.role_has_dependencies == 'true' }}
if: ${{ steps.get-role-dependencies.outputs.has_dependencies == 'true' }}
uses: https://git.michaelsasser.org/actions/ansible-lint@main
with:
args: ${{ inputs.args }}
requirements_file: "${{ inputs.requirements_file }}"
requirements_file: ${{ github.workspace }}/meta/requirements.yml
- name: Run ansible-lint (without dependencies) # same but without: requirements_file
if: ${{ steps.get-role-has-dependencies.outputs.role_has_dependencies == 'false' }}
if: ${{ steps.get-role-dependencies.outputs.has_dependencies == 'false' }}
uses: https://git.michaelsasser.org/actions/ansible-lint@main
with:
args: ${{ inputs.args }}