From 9d672564c3f27681579d66b0246f82ecfcbd2e25 Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 9 Jan 2025 19:15:19 +0900 Subject: [PATCH 1/2] ci: fix accessibility of secrets when permissions are explicitly set --- .github/workflows/spam-comment-detection.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spam-comment-detection.yaml b/.github/workflows/spam-comment-detection.yaml index e44f106c5d..e5862389c0 100644 --- a/.github/workflows/spam-comment-detection.yaml +++ b/.github/workflows/spam-comment-detection.yaml @@ -46,4 +46,4 @@ jobs: ISSUE_NUMBER: ${{ github.event.issue.number }} REPO_OWNER: ${{github.repository_owner }} REPO_NAME: ${{ github.event.repository.name }} - SPAM_WORDS: ${{ github.secrets.SPAM_WORDS }} + SPAM_WORDS: ${{ secrets.SPAM_WORDS }} From 2409017fecab280d9a7c74c49978197f8e83c577 Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 9 Jan 2025 19:15:50 +0900 Subject: [PATCH 2/2] ci: include http protocol when check if a link is external --- .github/workflows/spam-comment-detection.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spam-comment-detection.yaml b/.github/workflows/spam-comment-detection.yaml index e5862389c0..a6d46d855d 100644 --- a/.github/workflows/spam-comment-detection.yaml +++ b/.github/workflows/spam-comment-detection.yaml @@ -24,7 +24,7 @@ jobs: const issue_number = process.env.ISSUE_NUMBER const owner = process.env.REPO_OWNER const repo = process.env.REPO_NAME - const EXTERNAL_LINK_REGEXT = /https:\/\/(?!((\w+\.)?github\.com|github\.com|(\w+\.)?magickbase\.com|(\w+\.)?nervos\.org))/gi + const EXTERNAL_LINK_REGEXT = /https?:\/\/(?!((\w+\.)?github\.com|github\.com|(\w+\.)?magickbase\.com|(\w+\.)?nervos\.org))/gi if (spam_words.some(w => comment.includes(w))) { console.info(`Spam comment: ${comment}`) github.rest.issues.deleteComment({ owner, repo, comment_id })