Skip to content
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
75 changes: 75 additions & 0 deletions .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: YAML Lint

on:
pull_request:
types: [opened, synchronize, reopened]

defaults:
run:
shell: bash

concurrency:
group: yamllint-${{ github.event.pull_request.head.ref }}
cancel-in-progress: true

jobs:
yamllint:
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read

steps:
- name: Checkout Repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0

- name: Install yamllint
env:
YAMLLINT_VERSION: "1.38.0"
run: |
set -euo pipefail
python3 -m pip install --user "yamllint==${YAMLLINT_VERSION}"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"

- name: Identify Changed YAML Files
id: changed
env:
BASE_REF: ${{ github.base_ref }}
run: |
set -euo pipefail
files=$(git diff --name-only --diff-filter=ACMRT \
"origin/${BASE_REF}...HEAD" \
| grep -E '\.(yml|yaml)$' || true)
if [ -z "$files" ]; then
echo "No YAML/YML files changed; skipping lint."
echo "has_files=false" >> "$GITHUB_OUTPUT"
else
echo "Files to lint:"
echo "$files" | sed 's/^/ /'
echo "has_files=true" >> "$GITHUB_OUTPUT"
{
echo "files<<EOF"
echo "$files"
echo "EOF"
} >> "$GITHUB_OUTPUT"
fi

- name: Run yamllint
if: steps.changed.outputs.has_files == 'true'
env:
YAML_FILES: ${{ steps.changed.outputs.files }}
run: |
set -euo pipefail
echo "$YAML_FILES" | xargs -d '\n' -r yamllint --config-file .yamllint

- name: Failure summary
if: failure()
run: |
{
echo "### YAML lint failed";
echo "- Run: ${{ github.run_id }}";
echo "- Trigger: ${{ github.event_name }}";
echo "- Ref: ${{ github.ref }}";
} >> "$GITHUB_STEP_SUMMARY"
72 changes: 72 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Ansible
*.retry
*.log
MANIFEST.json
FILES.json
.ansible/
collections/*/changelogs/.plugin-cache.yaml
ansible_collections/

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual Environment
venv/
ENV/
env/
.venv

# IDE
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

# Testing
.pytest_cache/
.tox/
.coverage
htmlcov/
.molecule/
tests/output/

# Collection builds
*.tar.gz
build/*.tar.gz

# Temporary files
tmp/
temp/
*.tmp

# Secrets
.vault_pass
vault_pass.txt
*.pem
*.key
credentials.yml

# OS
Thumbs.db
29 changes: 29 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
extends: default

rules:
line-length:
max: 160
level: warning

indentation:
spaces: 2
indent-sequences: consistent

comments:
min-spaces-from-content: 1

comments-indentation: {}

document-start:
present: true

truthy:
allowed-values: ['true', 'false', 'yes', 'no']
check-keys: false

ignore: |
.github/
build/
.cache/
*.tar.gz
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Install individual collections from GitHub:

```bash
# Docker collection
ansible-galaxy collection install git+https://github.com/NIXKnight/Ansible-Collections.git#/collections/nixknight/docker,docker-0.1.4
ansible-galaxy collection install git+https://github.com/NIXKnight/Ansible-Collections.git#/collections/nixknight/docker,docker-0.1.5

# General collection
ansible-galaxy collection install git+https://github.com/NIXKnight/Ansible-Collections.git#/collections/nixknight/general,general-0.1.0
Expand Down
4 changes: 3 additions & 1 deletion collections/nixknight/docker/galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: "nixknight"
name: "docker"
version: "0.1.4"
version: "0.1.5"
readme: "README.md"
authors:
- "Saad Ali <engr.saadali786@gmail.com>"
Expand All @@ -12,3 +12,5 @@ tags:
- docker
- containers
- containerization
dependencies:
"community.docker": ">=3.0.0"
7 changes: 7 additions & 0 deletions collections/nixknight/docker/meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
requires_ansible: '>=2.15.0'

action_groups:
nixknight_docker:
- docker_compose_service_check
- docker_image_mgmt_plan
Loading