Skip to content

Commit d369dc2

Browse files
committed
Add GHA script for feature freeze
1 parent 27d00a5 commit d369dc2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/feature-freeze.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Feature freeze check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'clippy_lints/src/declared_lints.rs'
7+
8+
jobs:
9+
auto-comment:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check PR Changes
14+
id: pr-changes
15+
run: echo "::set-output name=changes::${{ toJson(github.event.pull_request.changed_files) }}"
16+
17+
- name: Create Comment
18+
if: steps.pr-changes.outputs.changes != '[]'
19+
run: |
20+
# Use GitHub API to create a comment on the PR
21+
PR_NUMBER=${{ github.event.pull_request.number }}
22+
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"
23+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
24+
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
25+
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"

0 commit comments

Comments
 (0)