@@ -6,20 +6,8 @@ branding:
66 icon : shield
77 color : red
88inputs :
9- path :
10- description : >
11- Specific path to lint instead of the default `.`. Multiple arguments are
12- not supported and you will need to alter linter configuration to
13- accommodate other use cases.
14- required : false
15- # That default is just a placeholder workaround for no arguments use-case
16- # Feeding "." or empty string to ansible-lint makes it believe it is a role
17- default : --show-relpath
189 args :
19- description : deprecated
20- deprecationMessage : >
21- Arbitrary args are no longer accepted, please use path instead and
22- linter own configuration file to change its behavior.
10+ description : Arguments to be passed to ansible-lint command
2311 required : false
2412 default : " "
2513runs :
@@ -30,27 +18,29 @@ runs:
3018 fetch-depth : 0 # needed by setuptools-scm
3119 submodules : true
3220
21+ - name : Generate ansible-lint-requirements.txt
22+ shell : bash
23+ run : |
24+ wget --output-file=$HOME/requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/${{ github.action_ref || 'main' }}/.config/requirements-lock.txt
25+
3326 - name : Set up Python
3427 uses : actions/setup-python@v4
3528 with :
3629 cache : pip
37- # As setting cache to pip fails if there is no requirements.txt, we
38- # trick it to also load /dev/null to avoid failure for no requirements.
39- cache-dependency-path : |
40- **/requirements*.txt
41- /dev/null
30+ cache-dependency-path : ~/requirements.txt
4231 python-version : " 3.11"
4332
4433 - name : Install ansible-lint
4534 shell : bash
4635 # We need to set the version manually because $GITHUB_ACTION_PATH is not
4736 # a git clone and setuptools-scm would not be able to determine the version.
4837 # git+https://github.com/ansible/ansible-lint@${{ github.action_ref || 'main' }}
38+ # SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.action_ref || 'main' }}
4939 run : |
5040 cd $GITHUB_ACTION_PATH
51- SETUPTOOLS_SCM_PRETEND_VERSION= ${{ github.action_ref || 'main' }} pip install ".[lock] "
41+ pip install "ansible-lint[lock] @ git+https://github.com/ansible/ansible-lint@ ${{ github.action_ref || 'main' }}"
5242 ansible-lint --version
5343
5444 - name : Run ansible-lint
5545 shell : bash
56- run : ansible-lint ${{ inputs.path }}
46+ run : ansible-lint ${{ inputs.args }}
0 commit comments