Bläddra i källkod

ci: temp fix for semgrep (#17228)

* ci: respekt my authoritah

* ci: use pip semgrep
version-14
Ankush Menat 2 år sedan
committed by GitHub
förälder
incheckning
9bd753551b
Ingen känd nyckel hittad för denna signaturen i databasen GPG-nyckel ID: 4AEE18F83AFDEB23
2 ändrade filer med 11 tillägg och 13 borttagningar
  1. +4
    -4
      .github/helper/roulette.py
  2. +7
    -9
      .github/workflows/linters.yml

+ 4
- 4
.github/helper/roulette.py Visa fil

@@ -77,13 +77,13 @@ if __name__ == "__main__":
updated_py_file_count = len(list(filter(is_py, files_list))) updated_py_file_count = len(list(filter(is_py, files_list)))
only_py_changed = updated_py_file_count == len(files_list) only_py_changed = updated_py_file_count == len(files_list)


if ci_files_changed:
print("CI related files were updated, running all build processes.")

elif has_skip_ci_label(pr_number, repo):
if has_skip_ci_label(pr_number, repo):
print("Found `Skip CI` label on pr, stopping build process.") print("Found `Skip CI` label on pr, stopping build process.")
sys.exit(0) sys.exit(0)


elif ci_files_changed:
print("CI related files were updated, running all build processes.")

elif only_docs_changed: elif only_docs_changed:
print("Only docs were updated, stopping build process.") print("Only docs were updated, stopping build process.")
sys.exit(0) sys.exit(0)


+ 7
- 9
.github/workflows/linters.yml Visa fil

@@ -11,10 +11,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3


- name: Set up Python 3.8
- name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: 3.8
python-version: '3.10'


- name: Install and Run Pre-commit - name: Install and Run Pre-commit
uses: pre-commit/action@v3.0.0 uses: pre-commit/action@v3.0.0
@@ -22,10 +22,8 @@ jobs:
- name: Download Semgrep rules - name: Download Semgrep rules
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules


- uses: returntocorp/semgrep-action@v1
env:
SEMGREP_TIMEOUT: 120
with:
config: >-
r/python.lang.correctness
./frappe-semgrep-rules/rules
- name: Download semgrep
run: pip install semgrep==0.97.0

- name: Run Semgrep rules
run: semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness

Laddar…
Avbryt
Spara