Skip to content

Commit b69d82f

Browse files
committed
pull latest label from PR for skip changelog action
1 parent 3e08448 commit b69d82f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/actions/changelog-check/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,19 @@ runs:
2727
fi
2828
shell: bash
2929

30+
- name: Get latest PR labels
31+
id: get_pr
32+
uses: octokit/request-action@v2.x
33+
with:
34+
route: GET /repos/${{ github.repository }}/issues/${{ inputs.pr_number }}
35+
env:
36+
GITHUB_TOKEN: ${{ github.token }}
37+
3038
- name: Check if 'skip changelog' label is present
3139
id: check_labels
3240
run: |
33-
SKIP_CHANGELOG_LABEL="${{ contains(github.event.pull_request.labels.*.name, 'skip changelog') }}"
41+
echo "PR labels: ${{ toJSON(fromJSON(steps.get_pr.outputs.data).labels.*.name) }}"
42+
SKIP_CHANGELOG_LABEL="${{ contains(fromJSON(steps.get_pr.outputs.data).labels.*.name, 'skip changelog') }}"
3443
if [ "$SKIP_CHANGELOG_LABEL" = "true" ]; then
3544
echo "Skip changelog label is present. Skipping changelog check."
3645
echo "SKIP_CHANGELOG_CHECK=true" >> $GITHUB_ENV

0 commit comments

Comments
 (0)