File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -24,18 +24,13 @@ jobs:
24
24
- name : Check Changelog
25
25
if : ${{ github.event_name == 'pull_request' }}
26
26
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."
27
+ if [[ -z $(grep -oP 'changelog: *\K\S+' <<< "$PR_BODY") ]]; then
28
+ echo '::error::Pull request message must contain 'changelog: ...'. Please add it.'
32
29
exit 1
33
- else
34
- echo "changelog: $output"
35
30
fi
36
31
env :
37
- PYTHONIOENCODING : ' utf-8 '
38
- PR_NUMBER : ' ${{ github.event.number }} '
32
+ PR_BODY : ${{ github.event.pull_request.body }})
33
+
39
34
40
35
# We need to have the "conclusion" job also on PR CI, to make it possible
41
36
# to add PRs to a merge queue.
You can’t perform that action at this time.
0 commit comments