File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -15,27 +15,18 @@ jobs:
1515 changelog :
1616 runs-on : ubuntu-latest
1717
18- defaults :
19- run :
20- shell : bash
21-
2218 steps :
2319 # Run
2420 - name : Check Changelog
2521 if : ${{ github.event_name == 'pull_request' }}
2622 run : |
27- body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" | \
28- python -c "import sys, json; print(json.load(sys.stdin)['body'])")
29- output=$(awk '/^changelog:\s*\S/ && !/changelog: \[.*\]: your change/' <<< "$body" | sed "s/changelog:\s*//g")
30- if [ -z "$output" ]; then
31- echo "ERROR: pull request message must contain 'changelog: ...' with your changelog. Please add it."
23+ if [[ -z $(grep -oP 'changelog: *\K\S+' <<< "$PR_BODY") ]]; then
24+ echo "::error::Pull request message must contain 'changelog: ...' with your changelog. Please add it."
3225 exit 1
33- else
34- echo "changelog: $output"
3526 fi
3627 env :
37- PYTHONIOENCODING : ' utf-8 '
38- PR_NUMBER : ' ${{ github.event.number }} '
28+ PR_BODY : ${{ github.event.pull_request.body }})
29+
3930
4031 # We need to have the "conclusion" job also on PR CI, to make it possible
4132 # to add PRs to a merge queue.
You can’t perform that action at this time.
0 commit comments