diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..1b18e28 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install linters + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends shellcheck yamllint + + - name: Lint Markdown + uses: DavidAnson/markdownlint-cli2-action@v19 + with: + globs: "**/*.md" + + - name: Lint YAML + run: yamllint . + + - name: Shellcheck + run: shellcheck scripts/*.sh + + - name: Validate skill frontmatter + run: | + set -e + fail=0 + for f in skills/*/SKILL.md; do + fm=$(awk 'BEGIN{c=0} /^---$/{c++; next} c==1{print} c>=2{exit}' "$f") + for key in name description; do + if ! printf '%s\n' "$fm" | grep -qE "^${key}:[[:space:]]"; then + echo "::error file=${f}::missing '${key}' in YAML frontmatter" + fail=1 + fi + done + done + exit $fail diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index c8d4210..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: CI - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Lint Markdown - uses: DavidAnson/markdownlint-cli2-action@v19 - with: - globs: "**/*.md" diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..cf2f005 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,7 @@ +extends: default + +rules: + line-length: disable + document-start: disable + truthy: + check-keys: false