Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Semgrep analysis #60

Merged
merged 5 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/reusable-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
permissions: {}

jobs:
test:
name: ${{ inputs.php }}
phpstan:
name: PHPStan on PHP ${{ inputs.php }}
runs-on: ubuntu-24.04
permissions:
contents: read
Expand Down Expand Up @@ -56,3 +56,26 @@

- name: Run static analysis
run: composer run test:phpstan

semgrep:
name: Semgrep
if: ${{ inputs.php != '7.4' }}
runs-on: ubuntu-24.04
permissions:
contents: read
timeout-minutes: 10
container:
image: semgrep/semgrep
steps:
- name: Debug
run: | #shell
echo '${{ toJSON(inputs) }}'
Fixed Show fixed Hide fixed
shell: bash

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false

- name: Run semgrep
run: semgrep --config "p/wordpress" --verbose .
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Plugins that use this library all use a similar setup in their workflows:
* Uses `reusable-static-analysis.yml`
* Installs PHP
* Runs static analysis with PHPStan
* Runs static analysis with Semgrep

### Workflow file linting

Expand Down
Loading