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