|
1 | 1 | ### Required actions to scan GitHub action workflows for security issues. |
2 | | -name: Scan GitHub Action workflows files for security issues |
| 2 | +name: 'Scan GitHub Action workflows files for security issues' |
3 | 3 |
|
4 | 4 | on: |
5 | 5 | pull_request: {} |
6 | 6 |
|
7 | 7 | permissions: |
8 | | - contents: read |
9 | | - security-events: write |
10 | | - actions: read |
| 8 | + contents: 'read' |
| 9 | + security-events: 'write' |
| 10 | + actions: 'read' |
11 | 11 |
|
12 | 12 | jobs: |
13 | 13 | semgrep: |
14 | | - name: semgrep-oss/scan |
15 | | - runs-on: ubuntu-latest |
| 14 | + name: 'semgrep-oss/scan' |
| 15 | + runs-on: 'ubuntu-latest' |
16 | 16 |
|
17 | 17 | container: |
18 | | - image: semgrep/semgrep |
| 18 | + image: 'index.docker.io/semgrep/semgrep@sha256:85782eaf09692e6dfb684cd3bad87ef315775814b01f76b4d15582e4ca7c1c89' # ratchet:semgrep/semgrep |
19 | 19 |
|
20 | 20 | # Skip any PR created by dependabot to avoid permission issues: |
21 | 21 | if: (github.actor != 'dependabot[bot]') |
22 | 22 |
|
23 | 23 | steps: |
24 | | - - name: Checkout Code |
25 | | - uses: actions/checkout@v4 |
26 | | - |
27 | | - - name: Checkout Workflow Config |
28 | | - uses: actions/checkout@v4 |
| 24 | + - name: 'Checkout Code' |
| 25 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 |
| 26 | + |
| 27 | + - name: 'Checkout Workflow Config' |
| 28 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 |
29 | 29 | env: |
30 | 30 | GH_REPO_OWNER: ${{ github.repository_owner }} |
31 | 31 | with: |
32 | 32 | repository: 'google/github-team' |
33 | 33 | path: action_scanning |
34 | | - |
35 | | - - name: Run Actions semgrep scan |
36 | | - run: semgrep scan --sarif --config action_scanning/semgrep-rules/actions >> semgrep-results-actions.sarif |
37 | | - |
38 | | - - name: Save Actions SARIF results as artifact |
39 | | - uses: actions/upload-artifact@v4 |
| 34 | + |
| 35 | + - name: 'Run Actions semgrep scan' |
| 36 | + run: 'semgrep scan --sarif --config action_scanning/semgrep-rules/actions >> semgrep-results-actions.sarif' |
| 37 | + |
| 38 | + - name: 'Save Actions SARIF results as artifact' |
| 39 | + uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' # ratchet:actions/upload-artifact@v4 |
40 | 40 | with: |
41 | | - name: semgrep-scan-results-actions |
42 | | - path: semgrep-results-actions.sarif |
43 | | - |
44 | | - - name: Upload Actions SARIF result to the GitHub Security Dashboard |
45 | | - uses: github/codeql-action/upload-sarif@v3 |
| 41 | + name: 'semgrep-scan-results-actions' |
| 42 | + path: 'semgrep-results-actions.sarif' |
| 43 | + |
| 44 | + - name: 'Upload Actions SARIF result to the GitHub Security Dashboard' |
| 45 | + uses: 'github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841' # ratchet:github/codeql-action/upload-sarif@v3 |
46 | 46 | with: |
47 | | - sarif_file: semgrep-results-actions.sarif |
| 47 | + sarif_file: 'semgrep-results-actions.sarif' |
48 | 48 | if: always() |
0 commit comments