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 2828 name : Ansible Lint # Naming the build is important to use it as a status check
2929 runs-on : ubuntu-latest
3030 steps :
31+ - uses : actions/checkout@v4
3132 - name : Run ansible-lint
3233 uses : ansible/ansible-lint@main # or version tag instead of 'main'
3334` ` `
Original file line number Diff line number Diff line change @@ -7,17 +7,20 @@ branding:
77 color : red
88inputs :
99 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`.
1119 required : false
1220 default : " "
1321runs :
1422 using : composite
1523 steps :
16- - uses : actions/checkout@v4
17- with :
18- fetch-depth : 0 # needed by setuptools-scm
19- submodules : true
20-
2124 # Due to GHA limitation, caching works only for files within GITHUB_WORKSPACE
2225 # folder, so we are forced to stick this temporary file inside .git, so it
2326 # will not affect the linted repository.
2932 wget --output-file=.git/ansible-lint-requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/${{ github.action_ref || 'main' }}/.config/requirements-lock.txt
3033
3134 - name : Set up Python
35+ if : inputs.setup_python == 'true'
3236 uses : actions/setup-python@v4
3337 with :
3438 cache : pip
4650 pip install "ansible-lint[lock] @ git+https://github.com/ansible/ansible-lint@${{ github.action_ref || 'main' }}"
4751 ansible-lint --version
4852
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+
4963 - name : Run ansible-lint
5064 shell : bash
65+ working-directory : ${{ steps.inputs.outputs.working_directory }}
5166 run : ansible-lint ${{ inputs.args }}
You can’t perform that action at this time.
0 commit comments