summaryrefslogtreecommitdiffstats
path: root/action.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
commit2fe34b6444502079dc0b84365ce82dbc92de308e (patch)
tree8fedcab52bbbc3db6c5aa909a88a7a7b81685018 /action.yml
parentInitial commit. (diff)
downloadansible-lint-upstream/6.17.2.tar.xz
ansible-lint-upstream/6.17.2.zip
Adding upstream version 6.17.2.upstream/6.17.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--action.yml46
1 files changed, 46 insertions, 0 deletions
diff --git a/action.yml b/action.yml
new file mode 100644
index 0000000..4c541bf
--- /dev/null
+++ b/action.yml
@@ -0,0 +1,46 @@
+---
+name: run-ansible-lint
+description: Run Ansible Lint
+author: Ansible by Red Hat <info@ansible.com>
+branding:
+ icon: shield
+ color: red
+inputs:
+ args:
+ description: Arguments to be passed to ansible-lint command
+ required: false
+ default: ""
+runs:
+ using: composite
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0 # needed by setuptools-scm
+ submodules: true
+
+ - name: Generate ansible-lint-requirements.txt
+ shell: bash
+ run: |
+ wget --output-file=$HOME/requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/${{ github.action_ref || 'main' }}/.config/requirements-lock.txt
+
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ cache: pip
+ cache-dependency-path: ~/requirements.txt
+ python-version: "3.11"
+
+ - name: Install ansible-lint
+ shell: bash
+ # We need to set the version manually because $GITHUB_ACTION_PATH is not
+ # a git clone and setuptools-scm would not be able to determine the version.
+ # git+https://github.com/ansible/ansible-lint@${{ github.action_ref || 'main' }}
+ # SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.action_ref || 'main' }}
+ run: |
+ cd $GITHUB_ACTION_PATH
+ pip install "ansible-lint[lock] @ git+https://github.com/ansible/ansible-lint@${{ github.action_ref || 'main' }}"
+ ansible-lint --version
+
+ - name: Run ansible-lint
+ shell: bash
+ run: ansible-lint ${{ inputs.args }}