| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
name: Action Lint |
| 5 |
on: |
| 6 |
pull_request: |
| 7 |
branches: ['main'] |
| 8 |
paths: |
| 9 |
- '.github/workflows/**' |
| 10 |
- '.github/actions/**' |
| 11 |
|
| 12 |
push: |
| 13 |
branches: ['main'] |
| 14 |
paths: |
| 15 |
- '.github/workflows/**' |
| 16 |
- '.github/actions/**' |
| 17 |
|
| 18 |
permissions: {} |
| 19 |
|
| 20 |
jobs: |
| 21 |
action-lint: |
| 22 |
permissions: |
| 23 |
contents: read |
| 24 |
name: Action lint |
| 25 |
runs-on: ubuntu-latest |
| 26 |
steps: |
| 27 |
- uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 |
| 28 |
with: |
| 29 |
egress-policy: block |
| 30 |
allowed-endpoints: > |
| 31 |
*.githubapp.com:443 |
| 32 |
api.github.com:443 |
| 33 |
github.com:443 |
| 34 |
go.dev:443 |
| 35 |
hooks.slack.com:443 |
| 36 |
release-assets.githubusercontent.com:443 |
| 37 |
|
| 38 |
- name: Check out code |
| 39 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| 40 |
with: |
| 41 |
persist-credentials: false |
| 42 |
|
| 43 |
- name: Find yamls |
| 44 |
id: get_yamls |
| 45 |
run: | |
| 46 |
set -ex |
| 47 |
mapfile -t yamls < <(find .github/workflows -name "*.y*ml" | grep -v dependabot.) |
| 48 |
echo "files=${yamls[*]}" >> "${GITHUB_OUTPUT}" |
| 49 |
|
| 50 |
- name: Action lint |
| 51 |
uses: step-security/action-actionlint@d364e70a116a460ed220d67b1ca2f2579c48a40a |
| 52 |
env: |
| 53 |
SHELLCHECK_OPTS: "--exclude=SC2129" |
| 54 |
with: |
| 55 |
actionlint_flags: ${{ steps.get_yamls.outputs.files }} |