From fa92a0d435cfd19fae0a350fb13f9b734a309fbf Mon Sep 17 00:00:00 2001 From: cd rubin Date: Tue, 9 Dec 2025 15:41:56 +0000 Subject: [PATCH] [semgrep] Fix multiline commit message, false positive on ipv6 addresses and the name Mary (#27015) --- .github/workflows/semgrep.yml | 2 +- .semgrep/style-guide-dates-in-docs.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index c5cf582546..6c3c270ee8 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -31,7 +31,7 @@ jobs: - name: Configure run: | git config --global --add safe.directory $PWD - echo "COMMIT_MESSAGE='$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }} | sed "s/\"/'/g")'" | tee /dev/stderr >> "$GITHUB_ENV" + echo "COMMIT_MESSAGE='$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }} | sed "s/\"/'/g" | tr "\n" " ") '" | tee /dev/stderr >> "$GITHUB_ENV" echo "(if the last commit message contains '[skip style guide checks]' Semgrep style guide rule checks will be skipped)" # Semgrep CI to run on Schedule (Cron) or Manual Dispatch diff --git a/.semgrep/style-guide-dates-in-docs.yaml b/.semgrep/style-guide-dates-in-docs.yaml index cd672da873..e7d45bcdf9 100644 --- a/.semgrep/style-guide-dates-in-docs.yaml +++ b/.semgrep/style-guide-dates-in-docs.yaml @@ -37,7 +37,7 @@ rules: - "/.semgrep/**" - "/.github/**" patterns: - - pattern-regex: "Jan|Feb|Mar[^k]|Apr|May[^b]|Jun[^k]|Jul|Aug|Sep|Nov|Dec[^i]" + - pattern-regex: "Jan|Feb|Mar[ c]|Apr|May[ \\.]|Jun[ e]|Jul|Aug|Sep|Nov|Dec[ e]" - id: style-guide-potential-date-year languages: [generic] @@ -58,4 +58,5 @@ rules: - "/.github/**" patterns: # ignore 2xxx- with a - at the end (double-escape because in string and not a range operator!) - - pattern-regex: "20[0-9][0-9][^\\-]" + # ignore 200!:: as part of IPv6 address + - pattern-regex: "20[0-9][0-9][^\\-:]"