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:
15
15
changelog :
16
16
runs-on : ubuntu-latest
17
17
18
- defaults :
19
- run :
20
- shell : bash
21
-
22
18
steps :
23
19
# Run
24
20
- name : Check Changelog
25
21
if : ${{ github.event_name == 'pull_request' }}
26
22
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."
32
25
exit 1
33
- else
34
- echo "changelog: $output"
35
26
fi
36
27
env :
37
- PYTHONIOENCODING : ' utf-8 '
38
- PR_NUMBER : ' ${{ github.event.number }} '
28
+ PR_BODY : ${{ github.event.pull_request.body }})
29
+
39
30
40
31
# We need to have the "conclusion" job also on PR CI, to make it possible
41
32
# to add PRs to a merge queue.
You can’t perform that action at this time.
0 commit comments