diff options
Diffstat (limited to '')
-rw-r--r-- | action.yml | 46 |
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 }} |