fix lint - checkout before action (#309)

* fix lint - checkout before action

* Update tests.yml

* Create .ansible-lint

---------

Co-authored-by: Ashwini Mhatre <mashu97@gmail.com>
Co-authored-by: Ashwini Mhatre <amhatre@redhat.com>
pull/316/head
Sagar Paul 2023-11-30 13:43:29 +05:30 committed by GitHub
parent 0f8c4e1d45
commit 9b87f10f0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 4 deletions

5
.ansible-lint Normal file
View File

@ -0,0 +1,5 @@
---
profile: production
exclude_paths:
- changelogs/changelog.yaml

13
.github/workflows/lint.yml vendored Normal file
View File

@ -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'

View File

@ -13,8 +13,6 @@ on: # yamllint disable-line rule:truthy
- cron: '0 0 * * *' - cron: '0 0 * * *'
jobs: jobs:
ansible-lint:
uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main
changelog: changelog:
uses: ansible-network/github_actions/.github/workflows/changelog.yml@main uses: ansible-network/github_actions/.github/workflows/changelog.yml@main
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
@ -28,7 +26,6 @@ jobs:
all_green: all_green:
if: ${{ always() }} if: ${{ always() }}
needs: needs:
- ansible-lint
- changelog - changelog
- integration - integration
- sanity - sanity
@ -38,7 +35,6 @@ jobs:
- run: >- - run: >-
python -c "assert 'failure' not in python -c "assert 'failure' not in
set([ set([
'${{ needs.ansible-lint.result }}',
'${{ needs.changelog.result }}', '${{ needs.changelog.result }}',
'${{ needs.integration.result }}', '${{ needs.integration.result }}',
'${{ needs.sanity.result }}', '${{ needs.sanity.result }}',