Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ansible linter action #11

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
exclude_paths:
# NOTE(luisd): AFAIK ansible-lint has neither an "include files only" configuration nor a glob implementation,
# so we exclude all yaml files manually from the root directory :/
- dev-cluster.yaml
- local-dev-cluster.yaml
- .kube-linter.yaml
- .github/
- .vscode/
- .git

sarif_file: ansible.sarif

kinds:
- playbook: '**/*-playbook.{yaml,yml}'
22 changes: 22 additions & 0 deletions .github/workflows/ansible-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: ansible-lint
on:
pull_request:
push:
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'
- name: Upload sarif
if: always()
Naapperas marked this conversation as resolved.
Show resolved Hide resolved
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ansible.sarif
category: ansible-lint
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vagrant/**
local-dev-cluster.yaml
local-dev-cluster.yaml
**.sarif
Loading