Skip to content

Commit

Permalink
GHA CI: add checking for GHA workflows
Browse files Browse the repository at this point in the history
PR #22200.

---------

Co-authored-by: userdocs <16525024+userdocs@users.noreply.github.com>
  • Loading branch information
Chocobo1 and userdocs authored Jan 25, 2025
1 parent e2341f5 commit 3ef4d0d
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 12 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/ci_file_health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ jobs:
ci:
name: Check
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install tools
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "*"
Expand All @@ -42,3 +46,26 @@ jobs:
done
# check diff, ignore "Automatically generated by ..." part
git diff -I '\.\\".*' --exit-code
- name: Check GitHub Actions workflow
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install zizmor
IGNORE_RULEID='(.ruleId != "template-injection")
and (.ruleId != "unpinned-uses")'
IGNORE_ID='(.id != "template-injection")
and (.id != "unpinned-uses")'
zizmor \
--format sarif \
--pedantic \
./ \
| jq "(.runs[].results |= map(select($IGNORE_RULEID)))
| (.runs[].tool.driver.rules |= map(select($IGNORE_ID)))" \
> "${{ runner.temp }}/zizmor_results.sarif"
- name: Upload zizmor results
uses: github/codeql-action/upload-sarif@v3
with:
category: zizmor
sarif_file: "${{ runner.temp }}/zizmor_results.sarif"
7 changes: 5 additions & 2 deletions .github/workflows/ci_macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: CI - macOS

on: [pull_request, push]

permissions:
actions: write
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -13,6 +12,8 @@ jobs:
ci:
name: Build
runs-on: macos-latest
permissions:
actions: write

strategy:
fail-fast: false
Expand All @@ -28,6 +29,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install dependencies
uses: Wandalen/wretry.action@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup python (auxiliary scripts)
uses: actions/setup-python@v5
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ci_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: CI - Ubuntu

on: [pull_request, push]

permissions:
actions: write
security-events: write
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -14,6 +12,9 @@ jobs:
ci:
name: Build
runs-on: ubuntu-latest
permissions:
actions: write
security-events: write

strategy:
fail-fast: false
Expand All @@ -30,6 +31,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install dependencies
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci_webui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: CI - WebUI

on: [pull_request, push]

permissions:
security-events: write
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -13,6 +12,8 @@ jobs:
ci:
name: Check
runs-on: ubuntu-latest
permissions:
security-events: write

defaults:
run:
Expand All @@ -21,6 +22,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup nodejs
uses: actions/setup-node@v4
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: CI - Windows

on: [pull_request, push]

permissions:
actions: write
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -13,6 +12,8 @@ jobs:
ci:
name: Build
runs-on: windows-latest
permissions:
actions: write

strategy:
fail-fast: false
Expand All @@ -27,6 +28,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup devcmd
uses: ilammy/msvc-dev-cmd@v1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/coverity-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install dependencies
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/stale_bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on:
schedule:
- cron: '0 0 * * *'

permissions:
pull-requests: write
permissions: {}

jobs:
stale:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Mark and close stale PRs
uses: actions/stale@v9
Expand Down

0 comments on commit 3ef4d0d

Please sign in to comment.