File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 28
28
name : Ansible Lint # Naming the build is important to use it as a status check
29
29
runs-on : ubuntu-latest
30
30
steps :
31
+ - uses : actions/checkout@v4
31
32
- name : Run ansible-lint
32
33
uses : ansible/ansible-lint@main # or version tag instead of 'main'
33
34
` ` `
Original file line number Diff line number Diff line change @@ -7,17 +7,20 @@ branding:
7
7
color : red
8
8
inputs :
9
9
args :
10
- description : Arguments to be passed to ansible-lint command
10
+ description : Arguments to be passed to ansible-lint command.
11
+ required : false
12
+ default : " "
13
+ setup_python :
14
+ description : If false, this action will not setup python and will instead rely on the already installed python.
15
+ required : false
16
+ default : true
17
+ working_directory :
18
+ description : The directory where to run ansible-lint from. Default is `github.workspace`.
11
19
required : false
12
20
default : " "
13
21
runs :
14
22
using : composite
15
23
steps :
16
- - uses : actions/checkout@v4
17
- with :
18
- fetch-depth : 0 # needed by setuptools-scm
19
- submodules : true
20
-
21
24
# Due to GHA limitation, caching works only for files within GITHUB_WORKSPACE
22
25
# folder, so we are forced to stick this temporary file inside .git, so it
23
26
# will not affect the linted repository.
29
32
wget --output-file=.git/ansible-lint-requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/${{ github.action_ref || 'main' }}/.config/requirements-lock.txt
30
33
31
34
- name : Set up Python
35
+ if : inputs.setup_python == 'true'
32
36
uses : actions/setup-python@v4
33
37
with :
34
38
cache : pip
46
50
pip install "ansible-lint[lock] @ git+https://github.com/ansible/ansible-lint@${{ github.action_ref || 'main' }}"
47
51
ansible-lint --version
48
52
53
+ - name : Process inputs
54
+ id : inputs
55
+ shell : bash
56
+ run : |
57
+ if [[ -n "${{ inputs.working_directory }}" ]]; then
58
+ echo "working_directory=${{ inputs.working_directory }}" >> $GITHUB_OUTPUT
59
+ else
60
+ echo "working_directory=${{ github.workspace }}" >> $GITHUB_OUTPUT
61
+ fi
62
+
49
63
- name : Run ansible-lint
50
64
shell : bash
65
+ working-directory : ${{ steps.inputs.outputs.working_directory }}
51
66
run : ansible-lint ${{ inputs.args }}
You can’t perform that action at this time.
0 commit comments