about summary refs log tree commit diff
diff options
context:
space:
mode:
authorblyxyas <blyxyas@gmail.com>2025-05-28 14:03:11 +0200
committerblyxyas <blyxyas@gmail.com>2025-05-28 14:03:11 +0200
commitd369dc2998e3f6b92dce967838905c7d0e34c865 (patch)
tree7b3a6998cd1807b6bfb3f9556c7208a920b819d7
parent27d00a53fc17de29511e501f07d5e491417fce05 (diff)
downloadrust-d369dc2998e3f6b92dce967838905c7d0e34c865.tar.gz
rust-d369dc2998e3f6b92dce967838905c7d0e34c865.zip
Add GHA script for feature freeze
-rw-r--r--.github/workflows/feature-freeze.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/.github/workflows/feature-freeze.yml b/.github/workflows/feature-freeze.yml
new file mode 100644
index 00000000000..1b3a2f4ca28
--- /dev/null
+++ b/.github/workflows/feature-freeze.yml
@@ -0,0 +1,25 @@
+name: Feature freeze check
+
+on:
+  pull_request:
+    paths:
+      - 'clippy_lints/src/declared_lints.rs'
+
+jobs:
+  auto-comment:
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Check PR Changes
+      id: pr-changes
+      run: echo "::set-output name=changes::${{ toJson(github.event.pull_request.changed_files) }}"
+
+    - name: Create Comment
+      if: steps.pr-changes.outputs.changes != '[]'
+      run: |
+        # Use GitHub API to create a comment on the PR
+        PR_NUMBER=${{ github.event.pull_request.number }}
+        COMMENT="**Seems that you are trying to add a new lint!**\nWe are currently in a [feature freeze](https://doc.rust-lang.org/nightly/clippy/development/feature_freeze.html), so we are delaying all lint-adding PRs to August 1st and focusing on bugfixes.\nThanks a lot for your contribution, and sorry for the inconvenience.\nWith ❤ from the Clippy team"
+        GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
+        COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
+        curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"
\ No newline at end of file