| 1 |
name: Lint GitHub Workflow YAML Files |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
pull_request: |
| 8 |
paths: |
| 9 |
- '.github/workflows/*.yml' |
| 10 |
- '.github/workflows/*.yaml' |
| 11 |
- '.github/actionlint.yaml' |
| 12 |
|
| 13 |
permissions: |
| 14 |
contents: read |
| 15 |
|
| 16 |
jobs: |
| 17 |
lint: |
| 18 |
runs-on: ubuntu-latest |
| 19 |
|
| 20 |
steps: |
| 21 |
- name: Checkout code |
| 22 |
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
| 23 |
|
| 24 |
- name: Set up Go |
| 25 |
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6 |
| 26 |
with: |
| 27 |
go-version: stable |
| 28 |
cache: false |
| 29 |
|
| 30 |
- name: Cache Go |
| 31 |
id: go-cache |
| 32 |
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 33 |
with: |
| 34 |
path: | |
| 35 |
~/go/bin |
| 36 |
~/go/pkg/mod |
| 37 |
key: go-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/go.sum') }} |
| 38 |
|
| 39 |
- name: Run Actionlint |
| 40 |
run: | |
| 41 |
make actionlint |
| 42 |
|
| 43 |
- name: Reminder to Address Linting Errors |
| 44 |
if: failure() |
| 45 |
run: echo "⚠️ Please address all linting errors before merging this pull request." |
| 46 |
|
| 47 |
- name: All linting checks passed |
| 48 |
if: success() |
| 49 |
run: echo "✅ All linting checks passed." |