From 695fc981d0d43363269efddaafac504e966d7001 Mon Sep 17 00:00:00 2001 From: Michael Sasser Date: Tue, 19 Nov 2024 04:21:55 +0100 Subject: [PATCH] fix: remove the dependency file input --- action.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/action.yml b/action.yml index a0be870..4acac46 100644 --- a/action.yml +++ b/action.yml @@ -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 }}