community.sap_install
community.sap_install copied to clipboard
collection: ansible-lint GH Action Workflow improvements
collection: ansible-lint GH Action Workflow improvements
Current implementation of GH Action Workflows for running ansible-lint and more, are difficult to maintain as it is DIY for all version numbers in the chain (e.g. ansible-lint > ansible-core > python packages).
At minimum we need to version lock on the current GH Actions referenced in the GH Action Workflow file.
However, we should consider alternatives for long-term maintainability.
Alternative method
The GitHub Action ansible-lint-action
now allows version lock to a specific release of Ansible Creator Execution Environment (a docker image containing locked versions of ansible-core
and ansible-lint
with their depedencies). The released docker images of Ansible Creator EE are easily referenced in the GH Action.
I would suggest we pivot to this method to better control our GH Action Workflows in the long-term.
Pseudocode example when using ansible-lint-action
version locked to an Ansible Creator EE version:
name: Ansible Lint
on: [push, pull_request]
jobs:
ansible-lint-job:
runs-on: ubuntu-latest
container:
image: docker://ghcr.io/ansible/creator-ee:v0.19.0 # Ansible Creator Execution Environment version lock
env:
# These tell ansible-lint to use github compatible annotation format:
GITHUB_ACTIONS: "true"
GITHUB_WORKFLOW: "{{ github.workflow.name }}"
steps:
- uses: actions/checkout@v3 # GitHub Action for Git Checkout version lock
- name: Ansible Lint Job Action
uses: ansible-community/[email protected] # GitHub Action for Ansible Lint version lock
with:
entrypoint: /usr/local/bin/ansible-lint
@sean-freeman I think this can also be close