2021-04-16 16:14:49 +00:00
|
|
|
name: Semgrep
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- develop
|
2021-05-11 12:57:20 +00:00
|
|
|
- version-13-hotfix
|
|
|
|
- version-13-pre-release
|
2021-04-16 16:14:49 +00:00
|
|
|
jobs:
|
|
|
|
semgrep:
|
|
|
|
name: Frappe Linter
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup python3
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
2021-05-11 12:57:20 +00:00
|
|
|
|
|
|
|
- name: Setup semgrep
|
2021-04-16 16:14:49 +00:00
|
|
|
run: |
|
|
|
|
python -m pip install -q semgrep
|
|
|
|
git fetch origin $GITHUB_BASE_REF:$GITHUB_BASE_REF -q
|
2021-05-11 12:57:20 +00:00
|
|
|
|
|
|
|
- name: Semgrep errors
|
|
|
|
run: |
|
2021-04-16 16:14:49 +00:00
|
|
|
files=$(git diff --name-only --diff-filter=d $GITHUB_BASE_REF)
|
|
|
|
[[ -d .github/helper/semgrep_rules ]] && semgrep --severity ERROR --config=.github/helper/semgrep_rules --quiet --error $files
|
|
|
|
semgrep --config="r/python.lang.correctness" --quiet --error $files
|
2021-05-11 12:57:20 +00:00
|
|
|
|
|
|
|
- name: Semgrep warnings
|
|
|
|
run: |
|
|
|
|
files=$(git diff --name-only --diff-filter=d $GITHUB_BASE_REF)
|
2021-04-16 16:14:49 +00:00
|
|
|
[[ -d .github/helper/semgrep_rules ]] && semgrep --severity WARNING --severity INFO --config=.github/helper/semgrep_rules --quiet $files
|