name: Semgrep on: workflow_dispatch: {} pull_request: {} push: branches: - main - release-please--branches--main paths: - .github/workflows/semgrep.yml schedule: # random HH:MM to avoid a load spike on GitHub Actions at 00:00 - cron: 53 18 * * * jobs: semgrep: name: semgrep/ci runs-on: ubuntu-latest permissions: contents: read env: SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} container: image: semgrep/semgrep:latest@sha256:326e5f41cc972bb423b764a14febbb62bbad29ee1c01820805d077dd868fea48 if: (github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]') steps: # Environment security # # This job runs in a container, which harden-runner cannot monitor from # inside — it logs "This job is running in a container" and does nothing # else. Neither policy has any effect here, so `audit` stays rather than # implying an egress allow-list is being enforced. Monitoring container # jobs needs harden-runner installed in a custom runner image. - name: Harden Runner uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1 with: disable-sudo-and-containers: true egress-policy: audit # Checkout # Most toolchains require checkout first - name: Checkout uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: persist-credentials: false - name: Run checks run: semgrep ci