aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Sawicki <contact@grub4k.xyz>2024-09-05 20:06:15 +0200
committerGitHub <noreply@github.com>2024-09-05 20:06:15 +0200
commitb6200bdcf3a9415ae36859188f9a57e3e461c696 (patch)
tree09f31f9f254ad3d872cc3adc6de9933707a2122c
parente8e6a982a1b659eed434d225d7922f632bac6568 (diff)
[ci] Add comment sanitization workflow (#10915)
Co-authored-by: bashonly <bashonly@protonmail.com> Authored by: bashonly, Grub4K
-rw-r--r--.github/ISSUE_TEMPLATE/1_broken_site.yml7
-rw-r--r--.github/ISSUE_TEMPLATE/2_site_support_request.yml7
-rw-r--r--.github/ISSUE_TEMPLATE/3_site_feature_request.yml7
-rw-r--r--.github/ISSUE_TEMPLATE/4_bug_report.yml7
-rw-r--r--.github/ISSUE_TEMPLATE/5_feature_request.yml7
-rw-r--r--.github/ISSUE_TEMPLATE/6_question.yml7
-rw-r--r--.github/workflows/issue-lockdown.yml (renamed from .github/workflows/antispam.yaml)5
-rw-r--r--.github/workflows/sanitize-comment.yml17
-rw-r--r--devscripts/make_issue_template.py7
9 files changed, 55 insertions, 16 deletions
diff --git a/.github/ISSUE_TEMPLATE/1_broken_site.yml b/.github/ISSUE_TEMPLATE/1_broken_site.yml
index 4a1442186..3b0ef323d 100644
--- a/.github/ISSUE_TEMPLATE/1_broken_site.yml
+++ b/.github/ISSUE_TEMPLATE/1_broken_site.yml
@@ -80,5 +80,8 @@ body:
- type: markdown
attributes:
value: |
- ### NOTE: Due to a recent increase in malicious spam activity, this issue will be automatically locked until it is triaged by a maintainer.
- ### If you receive any replies asking you download a file, do NOT follow the download links!
+ > [!CAUTION]
+ > ### GitHub is experiencing a high volume of malicious spam comments.
+ > ### If you receive any replies asking you download a file, do NOT follow the download links!
+ >
+ > Note that this issue may be temporarily locked as an anti-spam measure after it is opened.
diff --git a/.github/ISSUE_TEMPLATE/2_site_support_request.yml b/.github/ISSUE_TEMPLATE/2_site_support_request.yml
index 748885e85..c8702c356 100644
--- a/.github/ISSUE_TEMPLATE/2_site_support_request.yml
+++ b/.github/ISSUE_TEMPLATE/2_site_support_request.yml
@@ -92,5 +92,8 @@ body:
- type: markdown
attributes:
value: |
- ### NOTE: Due to a recent increase in malicious spam activity, this issue will be automatically locked until it is triaged by a maintainer.
- ### If you receive any replies asking you download a file, do NOT follow the download links!
+ > [!CAUTION]
+ > ### GitHub is experiencing a high volume of malicious spam comments.
+ > ### If you receive any replies asking you download a file, do NOT follow the download links!
+ >
+ > Note that this issue may be temporarily locked as an anti-spam measure after it is opened.
diff --git a/.github/ISSUE_TEMPLATE/3_site_feature_request.yml b/.github/ISSUE_TEMPLATE/3_site_feature_request.yml
index ac68a08c6..5a6d2b0fb 100644
--- a/.github/ISSUE_TEMPLATE/3_site_feature_request.yml
+++ b/.github/ISSUE_TEMPLATE/3_site_feature_request.yml
@@ -88,5 +88,8 @@ body:
- type: markdown
attributes:
value: |
- ### NOTE: Due to a recent increase in malicious spam activity, this issue will be automatically locked until it is triaged by a maintainer.
- ### If you receive any replies asking you download a file, do NOT follow the download links!
+ > [!CAUTION]
+ > ### GitHub is experiencing a high volume of malicious spam comments.
+ > ### If you receive any replies asking you download a file, do NOT follow the download links!
+ >
+ > Note that this issue may be temporarily locked as an anti-spam measure after it is opened.
diff --git a/.github/ISSUE_TEMPLATE/4_bug_report.yml b/.github/ISSUE_TEMPLATE/4_bug_report.yml
index 6ae107ec1..a17770f61 100644
--- a/.github/ISSUE_TEMPLATE/4_bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/4_bug_report.yml
@@ -73,5 +73,8 @@ body:
- type: markdown
attributes:
value: |
- ### NOTE: Due to a recent increase in malicious spam activity, this issue will be automatically locked until it is triaged by a maintainer.
- ### If you receive any replies asking you download a file, do NOT follow the download links!
+ > [!CAUTION]
+ > ### GitHub is experiencing a high volume of malicious spam comments.
+ > ### If you receive any replies asking you download a file, do NOT follow the download links!
+ >
+ > Note that this issue may be temporarily locked as an anti-spam measure after it is opened.
diff --git a/.github/ISSUE_TEMPLATE/5_feature_request.yml b/.github/ISSUE_TEMPLATE/5_feature_request.yml
index a2263bec5..c600a9dcb 100644
--- a/.github/ISSUE_TEMPLATE/5_feature_request.yml
+++ b/.github/ISSUE_TEMPLATE/5_feature_request.yml
@@ -67,5 +67,8 @@ body:
- type: markdown
attributes:
value: |
- ### NOTE: Due to a recent increase in malicious spam activity, this issue will be automatically locked until it is triaged by a maintainer.
- ### If you receive any replies asking you download a file, do NOT follow the download links!
+ > [!CAUTION]
+ > ### GitHub is experiencing a high volume of malicious spam comments.
+ > ### If you receive any replies asking you download a file, do NOT follow the download links!
+ >
+ > Note that this issue may be temporarily locked as an anti-spam measure after it is opened.
diff --git a/.github/ISSUE_TEMPLATE/6_question.yml b/.github/ISSUE_TEMPLATE/6_question.yml
index 27eb98bc8..57bc9daf5 100644
--- a/.github/ISSUE_TEMPLATE/6_question.yml
+++ b/.github/ISSUE_TEMPLATE/6_question.yml
@@ -73,5 +73,8 @@ body:
- type: markdown
attributes:
value: |
- ### NOTE: Due to a recent increase in malicious spam activity, this issue will be automatically locked until it is triaged by a maintainer.
- ### If you receive any replies asking you download a file, do NOT follow the download links!
+ > [!CAUTION]
+ > ### GitHub is experiencing a high volume of malicious spam comments.
+ > ### If you receive any replies asking you download a file, do NOT follow the download links!
+ >
+ > Note that this issue may be temporarily locked as an anti-spam measure after it is opened.
diff --git a/.github/workflows/antispam.yaml b/.github/workflows/issue-lockdown.yml
index 0fd867072..4b973e2e6 100644
--- a/.github/workflows/antispam.yaml
+++ b/.github/workflows/issue-lockdown.yml
@@ -1,4 +1,4 @@
-name: Anti-Spam
+name: Issue Lockdown
on:
issues:
types: [opened]
@@ -9,6 +9,7 @@ permissions:
jobs:
lockdown:
name: Issue Lockdown
+ if: vars.ISSUE_LOCKDOWN
runs-on: ubuntu-latest
steps:
- name: "Lock new issue"
@@ -17,4 +18,4 @@ jobs:
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPOSITORY: ${{ github.repository }}
run: |
- gh issue lock "${ISSUE_NUMBER}" -r too_heated -R "${REPOSITORY}"
+ gh issue lock "${ISSUE_NUMBER}" -R "${REPOSITORY}"
diff --git a/.github/workflows/sanitize-comment.yml b/.github/workflows/sanitize-comment.yml
new file mode 100644
index 000000000..45c87cdd4
--- /dev/null
+++ b/.github/workflows/sanitize-comment.yml
@@ -0,0 +1,17 @@
+name: Sanitize comment
+
+on:
+ issue_comment:
+ types: [created, edited]
+
+permissions:
+ issues: write
+
+jobs:
+ sanitize-comment:
+ name: Sanitize comment
+ if: vars.SANITIZE_COMMENT && !github.event.issue.pull_request
+ runs-on: ubuntu-latest
+ steps:
+ - name: Sanitize comment
+ uses: yt-dlp/sanitize-comment@v1
diff --git a/devscripts/make_issue_template.py b/devscripts/make_issue_template.py
index 4f782d8c6..8135689c7 100644
--- a/devscripts/make_issue_template.py
+++ b/devscripts/make_issue_template.py
@@ -49,8 +49,11 @@ VERBOSE_TMPL = '''
- type: markdown
attributes:
value: |
- ### NOTE: Due to a recent increase in malicious spam activity, this issue will be automatically locked until it is triaged by a maintainer.
- ### If you receive any replies asking you download a file, do NOT follow the download links!
+ > [!CAUTION]
+ > ### GitHub is experiencing a high volume of malicious spam comments.
+ > ### If you receive any replies asking you download a file, do NOT follow the download links!
+ >
+ > Note that this issue may be temporarily locked as an anti-spam measure after it is opened.
'''.strip()
NO_SKIP = '''