Skip to content

gh pr checkout 49 - Update yaml_format.yml #27

gh pr checkout 49 - Update yaml_format.yml

gh pr checkout 49 - Update yaml_format.yml #27

### Required actions to scan GitHub action workflows for security issues.
name: 'Scan GitHub Action workflows files for security issues'
on:
pull_request: {}
permissions:
contents: 'read'
security-events: 'write'
actions: 'read'
jobs:
semgrep:
name: 'semgrep-oss/scan'
runs-on: 'ubuntu-latest'
container:
image: 'index.docker.io/semgrep/semgrep@sha256:430d0dc85aa62d2e80c23fdad8e13891ba0f478f' # ratchet:semgrep/semgrep
# Skip any PR created by dependabot to avoid permission issues:
if: (github.actor != 'dependabot[bot]')
steps:
- name: 'Checkout Code'
uses: actions/checkout@430d0dc85aa62d2e80c23fdad8e13891ba0f478f # ratchet:actions/checkout@v4
- name: 'Checkout Workflow Config'
uses: actions/checkout@430d0dc85aa62d2e80c23fdad8e13891ba0f478f # ratchet:actions/checkout@v4
env:
GH_REPO_OWNER: ${{ github.repository_owner }}
with:
repository: 'google/github-team'
path: action_scanning
- name: 'Run Actions semgrep scan'
run: 'semgrep scan --sarif --config action_scanning/semgrep-rules --config "p/github-actions"
--sarif-output semgrep-results-actions.sarif || true'
- name: 'Save Actions SARIF results as artifact'
uses: 'actions/upload-artifact@430d0dc85aa62d2e80c23fdad8e13891ba0f478f' # ratchet:actions/upload-artifact@v4
with:
name: 'semgrep-scan-results-actions'
path: 'semgrep-results-actions.sarif'
- name: 'Upload Actions SARIF result to the GitHub Security Dashboard'
uses: 'github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841' # ratchet:github/codeql-action/upload-sarif@v3
with:
sarif_file: 'semgrep-results-actions.sarif'
if: always()