ci: make semgrep ignore existing errors (#26516)
This commit is contained in:
parent
d8668f78f4
commit
1b5f3cf605
@ -98,8 +98,6 @@ rules:
|
|||||||
languages: [python]
|
languages: [python]
|
||||||
severity: WARNING
|
severity: WARNING
|
||||||
paths:
|
paths:
|
||||||
exclude:
|
|
||||||
- test_*.py
|
|
||||||
include:
|
include:
|
||||||
- "*/**/doctype/*"
|
- "*/**/doctype/*"
|
||||||
|
|
||||||
|
34
.github/workflows/semgrep.yml
vendored
34
.github/workflows/semgrep.yml
vendored
@ -1,34 +1,20 @@
|
|||||||
name: Semgrep
|
name: Semgrep
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request: { }
|
||||||
branches:
|
push:
|
||||||
- develop
|
branches: ["develop"]
|
||||||
- version-13-hotfix
|
|
||||||
- version-13-pre-release
|
|
||||||
jobs:
|
jobs:
|
||||||
semgrep:
|
semgrep:
|
||||||
name: Frappe Linter
|
name: Frappe Linter
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Setup python3
|
- uses: returntocorp/semgrep-action@v1
|
||||||
uses: actions/setup-python@v2
|
env:
|
||||||
|
SEMGREP_TIMEOUT: 120
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
config: >-
|
||||||
|
r/python.lang.correctness
|
||||||
- name: Setup semgrep
|
.github/helper/semgrep_rules
|
||||||
run: |
|
|
||||||
python -m pip install -q semgrep
|
|
||||||
git fetch origin $GITHUB_BASE_REF:$GITHUB_BASE_REF -q
|
|
||||||
|
|
||||||
- name: Semgrep errors
|
|
||||||
run: |
|
|
||||||
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
|
|
||||||
|
|
||||||
- name: Semgrep warnings
|
|
||||||
run: |
|
|
||||||
files=$(git diff --name-only --diff-filter=d $GITHUB_BASE_REF)
|
|
||||||
[[ -d .github/helper/semgrep_rules ]] && semgrep --severity WARNING --severity INFO --config=.github/helper/semgrep_rules --quiet $files
|
|
||||||
|
Loading…
Reference in New Issue
Block a user