File tree Expand file tree Collapse file tree 10 files changed +37
-41
lines changed
Expand file tree Collapse file tree 10 files changed +37
-41
lines changed Original file line number Diff line number Diff line change 11# ## Required actions to scan GitHub action workflows for security issues.
22name : ' Scan GitHub Action workflows files for security issues'
3-
43on :
54 pull_request : {}
6-
75permissions :
86 contents : ' read'
97 security-events : ' write'
108 actions : ' read'
11-
129jobs :
1310 semgrep :
1411 name : ' semgrep-oss/scan'
1512 runs-on : ' ubuntu-latest'
16-
1713 container :
1814 image : ' index.docker.io/semgrep/semgrep@sha256:85782eaf09692e6dfb684cd3bad87ef315775814b01f76b4d15582e4ca7c1c89' # ratchet:semgrep/semgrep
19-
2015 # Skip any PR created by dependabot to avoid permission issues:
2116 if : (github.actor != 'dependabot[bot]')
22-
2317 steps :
2418 - name : ' Checkout Code'
2519 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
26-
2720 - name : ' Checkout Workflow Config'
2821 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
2922 env :
3023 GH_REPO_OWNER : ${{ github.repository_owner }}
3124 with :
3225 repository : ' google/github-team'
3326 path : action_scanning
34-
3527 - name : ' Run Actions semgrep scan'
3628 run : ' semgrep scan --sarif --config action_scanning/semgrep-rules/actions >> semgrep-results-actions.sarif'
37-
3829 - name : ' Save Actions SARIF results as artifact'
3930 uses : ' actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' # ratchet:actions/upload-artifact@v4
4031 with :
4132 name : ' semgrep-scan-results-actions'
4233 path : ' semgrep-results-actions.sarif'
43-
4434 - name : ' Upload Actions SARIF result to the GitHub Security Dashboard'
4535 uses : ' github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841' # ratchet:github/codeql-action/upload-sarif@v3
4636 with :
Original file line number Diff line number Diff line change 11# ## Ensure that markdown files are properly formatted
22name : ' Check Markdown Format'
3-
43on :
5- pull_request :
4+ pull_request :
65 paths :
76 - ' **.md'
8-
97jobs :
108 mdformat :
119 name : ' mdformat'
1210 runs-on : ' ubuntu-latest'
13-
1411 steps :
1512 - name : ' Checkout Code'
1613 uses : ' actions/checkout@v4'
17-
1814 - name : ' Check Markdown Format'
19- run : ' pipx run mdformat --check --wrap 100 .'
15+ run : ' tools/ mdformat --check --wrap 100 .'
Original file line number Diff line number Diff line change 11name : ' Publish Docs Site'
2-
32on :
43 push :
54 branches :
87 - ' **.md'
98 - ' .github/workflow/publish*'
109 workflow_dispatch :
11-
1210permissions :
1311 pages : ' write'
1412 id-token : ' write'
15-
1613jobs :
1714 build-and-deploy :
1815 name : " Build and Deploy Docs"
3128 with :
3229 folder : generated-pages
3330 force : false
34- clean-exclude : pr-preview/
31+ clean-exclude : pr-preview/
Original file line number Diff line number Diff line change 11name : ' Publish Preview of Docs Site'
2-
32on :
43 pull_request :
54 types :
65 - opened
76 - reopened
87 - synchronize
98 - closed
10-
119permissions :
1210 contents : ' write'
1311 pull-requests : ' write'
14-
1512jobs :
1613 build :
1714 name : " Build PR Preview Docs"
1815 runs-on : ' ubuntu-latest'
1916 steps :
20- - uses : ' actions/checkout@v4'
21- - name : ' Generate HTML from Markdown'
22- uses : ' ldeluigi/markdown-docs@latest'
23- with :
24- src : ' docs'
25- dst : ' generated-pages'
26- - name : ' Deploy GitHub Pages Preview'
27- uses : rossjrw/pr-preview-action@v1
28- with :
29- source-dir : ' ./generated-pages/'
17+ - uses : ' actions/checkout@v4'
18+ - name : ' Generate HTML from Markdown'
19+ uses : ' ldeluigi/markdown-docs@latest'
20+ with :
21+ src : ' docs'
22+ dst : ' generated-pages'
23+ - name : ' Deploy GitHub Pages Preview'
24+ uses : rossjrw/pr-preview-action@v1
25+ with :
26+ source-dir : ' ./generated-pages/'
Original file line number Diff line number Diff line change 11# ## Ensure that our local testing always passes
22name : ' Run semgrep tests'
3-
43on :
54 pull_request : {}
6-
75permissions :
86 contents : ' read'
97 actions : ' read'
10-
118jobs :
129 semgrep-tests :
1310 name : ' Run semgrep tests'
1411 runs-on : ' ubuntu-latest'
15-
1612 container :
1713 image : index.docker.io/semgrep/semgrep@sha256:85782eaf09692e6dfb684cd3bad87ef315775814b01f76b4d15582e4ca7c1c89 # ratchet:semgrep/semgrep
18-
1914 # Skip any PR created by dependabot to avoid permission issues:
2015 if : (github.actor != 'dependabot[bot]')
21-
2216 steps :
2317 - name : ' Checkout Code'
2418 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
25-
2619 - name : ' Run Actions semgrep scan'
2720 run : ' semgrep --test --config semgrep-rules semgrep-tests'
Original file line number Diff line number Diff line change 1+ # ## Ensure that Yaml files are properly formatted
2+ name : ' Check Yaml Format'
3+ on :
4+ pull_request :
5+ paths :
6+ - ' **.yml'
7+ - ' **.yaml'
8+ jobs :
9+ yamlfmt :
10+ name : ' yamlfmt'
11+ runs-on : ' ubuntu-latest'
12+ steps :
13+ - name : ' Checkout Code'
14+ uses : ' actions/checkout@v4'
15+ - name : ' Check Yaml Format'
16+ run : ' tools/yamlfmt --lint .'
Original file line number Diff line number Diff line change 1+ formatter:
2+ max_line_length: 100
3+ trim_trailing_whitespace: true
Original file line number Diff line number Diff line change 11on :
22 # ruleid: pull-request-target-needs-exception
3- pull_request_target:
3+ pull_request_target :
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ pipx run mdformat $*
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ docker run -v " $( pwd) :/project" ghcr.io/google/yamlfmt:latest $*
You can’t perform that action at this time.
0 commit comments