-
Notifications
You must be signed in to change notification settings - Fork 16
74 lines (61 loc) · 1.94 KB
/
lint-github-actions.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Generated by Gabo (https://github.com/ashishb/gabo)
---
# Run this locally with act - https://github.com/nektos/act
# act -j lintGitHubActions
name: Lint GitHub Actions
on: # yamllint disable-line rule:truthy
push:
branches: [master, main]
paths:
- ".github/workflows/**.yml"
- ".github/workflows/**.yaml"
pull_request:
branches: [master, main]
paths:
- ".github/workflows/**.yml"
- ".github/workflows/**.yaml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lintGitHubActionsWithActionLint:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
sparse-checkout: |
.github/workflows
sparse-checkout-cone-mode: false
- name: Lint GitHub Actions
uses: reviewdog/action-actionlint@v1
- name: Check GitHub Actions with 'actionlint'
# Ref: https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
# shellcheck is too noisy and disabled
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -shellcheck=
shell: bash
lintGitHubActionsForSecurity:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
security-events: write
contents: read
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
sparse-checkout: |
.github/workflows
sparse-checkout-cone-mode: false
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install zizmor
run: cargo install zizmor
- name: Run zizmor on GitHub Actions
run: zizmor .github/workflows/*