File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -44,12 +44,27 @@ jobs:
4444
4545 - name : Check changelog
4646 run : |
47- base_ref="${{ github.base_ref }}"
48- if [ -z "$base_ref" ]; then
49- base_ref="master"
47+ EVENT_NAME="${{ github.event_name }}"
48+ BASE_REF="${{ github.base_ref }}"
49+ if [ -z "$BASE_REF" ]; then
50+ BASE_REF="master"
5051 fi
51- if [[ -z "$(git log origin/$base_ref..HEAD --oneline --grep='Changelog-')" && "$(git rev-parse --abbrev-ref HEAD)" != "$base_ref" ]]; then
52- echo "::error::'Changelog' entry is missing in all commits" && exit 1
52+ echo "Event Name: $EVENT_NAME"
53+ echo "Base Ref: $BASE_REF"
54+
55+ if [ "$EVENT_NAME" = "pull_request" ]; then
56+ PR_DESCRIPTION="$(echo '${{ github.event.pull_request.body }}')"
57+ echo "PR Description: $PR_DESCRIPTION"
58+ if [[ -z "$(git log origin/$BASE_REF..HEAD --oneline --grep='Changelog-')" && \
59+ "$(git rev-parse --abbrev-ref HEAD)" != "$BASE_REF" && \
60+ "$PR_DESCRIPTION" != *"Changelog-None"* ]]; then
61+ echo "::error::'Changelog' entry is missing in all commits, and 'Changelog-None' not specified in the PR description"
62+ exit 1
63+ else
64+ echo "Changelog found."
65+ fi
66+ else
67+ echo "Not a PR event."
5368 fi
5469
5570 - name : Set up Python 3.8
You can’t perform that action at this time.
0 commit comments