Files
.github/.gitea/workflows/ops-lint.yml
T
poli0981andClaude Opus 5.5 cd34ce42c7 ci: lint the ops workflows before callers pin them
ops-lint.yml runs actionlint 1.7.12 with shellcheck 0.11.0 (both
pinned, SHA-256 verified) over .gitea/workflows, and compiles the
Python. .github/actionlint.yaml ignores only what actionlint does not
know about Gitea: the releases scope, full-URL actions, and the
switched-off macOS workflow. All 21 workflows pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MnPQKxkPgL2sb8BqwHKv5k
2026-11-23 17:50:34 +07:00

70 lines
2.9 KiB
YAML

# Self-check for the ops repo: the workflows here are linted before any caller pins them
# (runbook §4.1).
# - actionlint, with shellcheck on every `run:` script. .github/actionlint.yaml ignores only
# the Gitea features actionlint does not know (the `releases` scope, full-URL actions, the
# switched-off macOS workflow).
# - Python syntax of the notifier script and the tools.
# Both tools are downloaded at pinned versions and SHA-256 verified. Renovate does not update
# them (they are not actions): bump version and checksum together, by hand.
name: Ops lint
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ops-lint-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: actionlint + Python
runs-on: ubuntu-latest # Gitea: Docker, docker.gitea.com/runner-images
timeout-minutes: 10
permissions:
contents: read
env:
ACTIONLINT_VERSION: 1.7.12
ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 # actionlint_1.7.12_linux_amd64.tar.gz (release checksums file)
SHELLCHECK_VERSION: v0.11.0
SHELLCHECK_SHA256: 8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198 # shellcheck-v0.11.0.linux.x86_64.tar.xz (no checksums file upstream; hashed 2026-11-23)
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install actionlint ${{ env.ACTIONLINT_VERSION }} + shellcheck ${{ env.SHELLCHECK_VERSION }}
run: |
set -euo pipefail
tmp="${RUNNER_TEMP:-/tmp}"
bin="$tmp/lint-bin"
mkdir -p "$bin"
curl -fsSL --retry 3 -o "$tmp/actionlint.tar.gz" \
"https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
echo "${ACTIONLINT_SHA256} $tmp/actionlint.tar.gz" | sha256sum -c -
tar -xzf "$tmp/actionlint.tar.gz" -C "$bin" actionlint
curl -fsSL --retry 3 -o "$tmp/shellcheck.tar.xz" \
"https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
echo "${SHELLCHECK_SHA256} $tmp/shellcheck.tar.xz" | sha256sum -c -
tar -xJf "$tmp/shellcheck.tar.xz" -C "$bin" --strip-components=1 "shellcheck-${SHELLCHECK_VERSION}/shellcheck"
echo "$bin" >> "$GITHUB_PATH"
- name: actionlint
run: |
actionlint -version
shellcheck --version | sed -n 2p
actionlint -color -config-file .github/actionlint.yaml \
-shellcheck "$(command -v shellcheck)" .gitea/workflows/*.yml
- name: Python syntax
run: |
python3 --version
python3 -m py_compile .github/scripts/*.py tools/*.py