Skip to content

Commit cd8d5da

Browse files
committed
Cleanup feature_freeze
1 parent 60a978d commit cd8d5da

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

.github/workflows/feature_freeze.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,28 @@ jobs:
2020
# of the pull request, as malicious code would be able to access the private
2121
# GitHub token.
2222
steps:
23-
- name: Check PR Changes
24-
id: pr-changes
25-
run: echo "::set-output name=changes::${{ toJson(github.event.pull_request.changed_files) }}"
26-
27-
- name: Create Comment
28-
if: steps.pr-changes.outputs.changes != '[]'
29-
run: |
30-
# Use GitHub API to create a comment on the PR
31-
PR_NUMBER=${{ github.event.pull_request.number }}
32-
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 September 18 and focusing on bugfixes.\nThanks a lot for your contribution, and sorry for the inconvenience.\nWith ❤ from the Clippy team\n\n@rustbot note Feature-freeze\n@rustbot blocked\n@rustbot label +A-lint\n"
33-
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
34-
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
35-
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"
23+
- name: Add freeze warning comment
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
GITHUB_REPOSITORY: ${{ github.repository }}
27+
PR_NUMBER: ${{ github.event.pull_request.number }}
28+
run: |
29+
COMMENT=$(cat <<EOF
30+
**Seems that you are trying to add a new lint!**
31+
32+
We 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 September 18 and [focusing on bugfixes](https://github.com/rust-lang/rust-clippy/issues/15086).
33+
34+
Thanks a lot for your contribution, and sorry for the inconvenience.
35+
36+
With ❤ from the Clippy team.
37+
38+
@rustbot note Feature-freeze
39+
@rustbot blocked
40+
@rustbot label +A-lint
41+
EOF
42+
)
43+
curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
44+
-H "Content-Type: application/json" \
45+
-X POST \
46+
--data "{\"body\":\"$COMMENT\"}" \
47+
"https://api.github.com/repos/$REPO/issues/$PR_NUMBER/comments"

0 commit comments

Comments
 (0)