Skip to content

Commit 69da394

Browse files
tarun-etikalaclaude
andcommitted
feat: add actionlint to CI and pre-commit for workflow validation
Add actionlint as a step in the Code Quality CI workflow using the SHA-pinned raven-actions/actionlint action (v2.1.2, actionlint 1.7.12). Add .pre-commit-config.yaml with markdownlint and actionlint hooks. Update CONTRIBUTING.md with pre-commit setup instructions. Ref: RHAIENG-4067 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 353500c commit 69da394

3 files changed

Lines changed: 36 additions & 12 deletions

File tree

.github/workflows/code-quality.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ jobs:
4141
uses: DavidAnson/markdownlint-cli2-action@ce4853d43830c74c1753b39f3cf40f71c2031eb9 # v23.0.0
4242
with:
4343
globs: "**/*.md"
44+
45+
- name: Actionlint
46+
uses: raven-actions/actionlint@205b530c5d9fa8f44ae9ed59f341a0db994aa6f8 # v2.1.2
47+
with:
48+
version: 1.7.12

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/DavidAnson/markdownlint-cli2
3+
rev: v0.22.1
4+
hooks:
5+
- id: markdownlint-cli2
6+
7+
- repo: https://github.com/rhysd/actionlint
8+
rev: v1.7.12
9+
hooks:
10+
- id: actionlint

CONTRIBUTING.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,40 @@ Before submitting, please read our [Code of Conduct](CODE_OF_CONDUCT.md). By par
1616

1717
## Linting and formatting
1818

19-
This project uses [ruff](https://docs.astral.sh/ruff/) for Python linting and formatting, and [markdownlint](https://github.com/DavidAnson/markdownlint) for Markdown linting. Both run as blocking CI checks on all pull requests via the `Code Quality` workflow.
19+
This project uses [ruff](https://docs.astral.sh/ruff/) (Python), [markdownlint](https://github.com/DavidAnson/markdownlint) (Markdown), and [actionlint](https://github.com/rhysd/actionlint) (GitHub Actions workflows). All three run as blocking CI checks on every pull request via the `Code Quality` workflow.
2020

21-
### Python (ruff)
21+
Markdownlint and actionlint are configured as [pre-commit](https://pre-commit.com/) hooks. Set up once and they run automatically on every commit:
2222

23-
Run locally before pushing:
23+
```bash
24+
uv tool install pre-commit
25+
pre-commit install
26+
```
27+
28+
To run all hooks manually against the entire repo:
2429

2530
```bash
26-
uv tool install ruff==0.15.11
27-
ruff check . # lint
28-
ruff format --check . # format check
29-
ruff format . # auto-format
31+
pre-commit run --all-files
3032
```
3133

32-
Configuration is in [`ruff.toml`](ruff.toml) at the repo root.
34+
To run a specific linter:
3335

34-
### Markdown (markdownlint)
36+
```bash
37+
pre-commit run markdownlint-cli2 --all-files # Markdown lint
38+
pre-commit run actionlint --all-files # GitHub Actions workflow lint
39+
```
40+
41+
### Python (ruff)
3542

3643
Run locally before pushing:
3744

3845
```bash
39-
npx markdownlint-cli2@0.22.1 "**/*.md" # lint
40-
npx markdownlint-cli2@0.22.1 --fix "**/*.md" # auto-fix
46+
uv tool install ruff==0.15.11
47+
ruff check . # lint
48+
ruff format --check . # format check
49+
ruff format . # auto-format
4150
```
4251

43-
Configuration is in [`.markdownlint.jsonc`](.markdownlint.jsonc) (rules) and [`.markdownlint-cli2.yaml`](.markdownlint-cli2.yaml) (ignored paths) at the repo root.
52+
Configuration files: [`ruff.toml`](ruff.toml), [`.markdownlint.jsonc`](.markdownlint.jsonc), [`.markdownlint-cli2.yaml`](.markdownlint-cli2.yaml), [`.pre-commit-config.yaml`](.pre-commit-config.yaml).
4453

4554
## Commit message conventions
4655

0 commit comments

Comments
 (0)