File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,41 @@ concurrency:
1717 cancel-in-progress : true
1818
1919jobs :
20+ changelog :
21+ runs-on : ubuntu-latest
22+
23+ defaults :
24+ run :
25+ shell : bash
26+
27+ steps :
28+ - name : Checkout
29+ uses : actions/checkout@v4
30+ with :
31+ # Unsetting this would make so that any malicious package could get our Github Token
32+ persist-credentials : false
33+
34+ # Run
35+ - name : Check Changelog
36+ run : |
37+ body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR_NUMBER" | \
38+ python -c "import sys, json; print(json.load(sys.stdin)['body'])")
39+ output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || {
40+ echo "ERROR: pull request message must contain 'changelog: ...'. Add it " \
41+ "and push (or force-push) the pull request to trigger a new check."
42+ exit 1
43+ }
44+ if [[ "$output" = "none" ]]; then
45+ echo "WARNING: changelog is 'none'"
46+ else
47+ echo "changelog: $output"
48+ fi
49+ env :
50+ PYTHONIOENCODING : ' utf-8'
51+ PR_NUMBER : ' ${{ github.event.number }}'
2052 base :
2153 # NOTE: If you modify this job, make sure you copy the changes to clippy_mq.yml
54+ needs : changelog
2255 runs-on : ubuntu-latest
2356
2457 steps :
You can’t perform that action at this time.
0 commit comments