From 092f9077245989af4ff529da3121cd747e77bf00 Mon Sep 17 00:00:00 2001 From: tequ Date: Tue, 24 Jun 2025 19:57:41 +0900 Subject: [PATCH] remove checkpatterns workflow --- .github/workflows/build-in-docker.yml | 12 +--------- .github/workflows/checkpatterns.yml | 20 ----------------- suspicious_patterns.sh | 32 --------------------------- 3 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 .github/workflows/checkpatterns.yml delete mode 100755 suspicious_patterns.sh diff --git a/.github/workflows/build-in-docker.yml b/.github/workflows/build-in-docker.yml index 9d959bbc9..e57dda8b4 100644 --- a/.github/workflows/build-in-docker.yml +++ b/.github/workflows/build-in-docker.yml @@ -32,19 +32,9 @@ jobs: clean: true fetch-depth: 2 # Only get the last 2 commits, to avoid fetching all history - checkpatterns: - runs-on: [self-hosted, vanity] - needs: checkout - defaults: - run: - working-directory: ${{ needs.checkout.outputs.checkout_path }} - steps: - - name: Check for suspicious patterns - run: /bin/bash suspicious_patterns.sh - build: runs-on: [self-hosted, vanity] - needs: [checkpatterns, checkout] + needs: [checkout] defaults: run: working-directory: ${{ needs.checkout.outputs.checkout_path }} diff --git a/.github/workflows/checkpatterns.yml b/.github/workflows/checkpatterns.yml deleted file mode 100644 index 8b60a12e5..000000000 --- a/.github/workflows/checkpatterns.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: checkpatterns - -on: [push, pull_request] - -jobs: - checkpatterns: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Check for suspicious patterns - run: | - if [ -f "suspicious_patterns.sh" ]; then - bash suspicious_patterns.sh - else - echo "Warning: suspicious_patterns.sh not found, skipping check" - # Still exit with success for compatibility with dependent jobs - exit 0 - fi diff --git a/suspicious_patterns.sh b/suspicious_patterns.sh deleted file mode 100755 index 39287a6a1..000000000 --- a/suspicious_patterns.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Get the repository's root directory -repo_root=$(git rev-parse --show-toplevel) - -# Get a list of files changed in the last commit with their relative paths -files_changed=$(git diff --name-only --relative HEAD~1 HEAD) - -# Loop through each file and search for the patterns -for file in $files_changed; do - # Skip if the file is Import_test.cpp (exact filename match regardless of path) - if [[ "$(basename "$file")" == "Import_test.cpp" ]]; then - continue - fi - - # Construct the absolute path - absolute_path="$repo_root/$file" - - # Check if the file exists (it might have been deleted) - if [ -f "$absolute_path" ]; then - # Search the file for the given patterns, but exclude lines containing 'public_key' - grep_output=$(grep -n -E '(([^rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]|^)(s|p)[rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]{25,60}([^(]|$)))|([^A-Fa-f0-9](02|03|ED)[A-Fa-f0-9]{64})' "$absolute_path" | grep -v "public_key") - - # Check if grep found any matches - if [ ! -z "$grep_output" ]; then - # Suspicious patterns were found - echo "Error: Suspicious patterns were found in $absolute_path." - echo "$grep_output" - exit 1 - fi - fi -done