From b2fdc720929a5c3cb03be64ffd383f767db236b2 Mon Sep 17 00:00:00 2001 From: Sagar Paul Date: Thu, 30 Nov 2023 12:33:46 +0530 Subject: [PATCH] fix lint workflow, update reference (#432) * fix lint workflow, update reference * fix lint checkout * Update .ansible-lint * Update tests.yml --------- Co-authored-by: Ruchi Pakhle <72685035+Ruchip16@users.noreply.github.com> Co-authored-by: Ashwini Mhatre Co-authored-by: Ashwini Mhatre --- .ansible-lint | 7 +++++++ .github/workflows/lint.yml | 13 +++++++++++++ .github/workflows/tests.yml | 4 ---- changelogs/fragments/trivial_lint.yaml | 3 +++ 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 .ansible-lint create mode 100644 .github/workflows/lint.yml create mode 100644 changelogs/fragments/trivial_lint.yaml diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 000000000..4ff85b9c0 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,7 @@ +--- +profile: production +exclude_paths: + - changelogs/changelog.yaml +skip_list: + # ansible-lint does not like the `import-3.11` ignore in tests/sanity/ignore-*.txt + - sanity diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..4e45c595d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,13 @@ +--- +name: ansible-lint +on: # yamllint disable-line rule:truthy + pull_request: + branches: ["main"] +jobs: + build: + name: Ansible Lint # Naming the build is important to use it as a status check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run ansible-lint + uses: ansible/ansible-lint@main # or version tag instead of 'main' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 21f8ea565..506c33aa0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,8 +13,6 @@ on: # yamllint disable-line rule:truthy - cron: '0 0 * * *' jobs: - ansible-lint: - uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main changelog: uses: ansible-network/github_actions/.github/workflows/changelog.yml@main if: github.event_name == 'pull_request' @@ -31,7 +29,6 @@ jobs: all_green: if: ${{ always() }} needs: - - ansible-lint - changelog - sanity - unit-galaxy @@ -41,7 +38,6 @@ jobs: - run: >- python -c "assert 'failure' not in set([ - '${{ needs.ansible-lint.result }}', '${{ needs.changelog.result }}', '${{ needs.sanity.result }}', '${{ needs.unit-galaxy.result }}', diff --git a/changelogs/fragments/trivial_lint.yaml b/changelogs/fragments/trivial_lint.yaml new file mode 100644 index 000000000..744f36321 --- /dev/null +++ b/changelogs/fragments/trivial_lint.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - "Fix lint action reference."