mirror of
https://github.com/ashishb/android-security-awesome.git
synced 2025-01-31 08:37:28 +00:00
ci: add GitHub Actions linter
This commit is contained in:
parent
89aed9bdb1
commit
50cdb57216
74
.github/workflows/lint-github-actions.yaml
vendored
Normal file
74
.github/workflows/lint-github-actions.yaml
vendored
Normal file
@ -0,0 +1,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/*
|
2
.github/workflows/lint-markdown.yaml
vendored
2
.github/workflows/lint-markdown.yaml
vendored
@ -27,6 +27,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Set up Ruby
|
- name: Set up Ruby
|
||||||
# See https://github.com/ruby/setup-ruby#versioning
|
# See https://github.com/ruby/setup-ruby#versioning
|
||||||
|
2
.github/workflows/lint-shell-script.yaml
vendored
2
.github/workflows/lint-shell-script.yaml
vendored
@ -30,6 +30,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Run ShellCheck
|
- name: Run ShellCheck
|
||||||
uses: ludeeus/action-shellcheck@2.0.0
|
uses: ludeeus/action-shellcheck@2.0.0
|
||||||
|
3
.github/workflows/lint-yaml.yaml
vendored
3
.github/workflows/lint-yaml.yaml
vendored
@ -31,6 +31,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Check YAML files with linter
|
- name: Check YAML files with linter
|
||||||
uses: ibiqlik/action-yamllint@v3
|
uses: ibiqlik/action-yamllint@v3
|
||||||
with:
|
with:
|
||||||
|
2
.github/workflows/validate-links.yml
vendored
2
.github/workflows/validate-links.yml
vendored
@ -30,6 +30,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
Loading…
Reference in New Issue
Block a user