This is an automated email from the ASF dual-hosted git repository.
sjaranowski pushed a commit to branch v4
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git
The following commit(s) were added to refs/heads/v4 by this push:
new fe5337b Add comment to merged PR with missing label
fe5337b is described below
commit fe5337b9dbdb745a77a71f9ad54273d6fa96280e
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Sun Jul 6 14:53:28 2025 +0200
Add comment to merged PR with missing label
---
.github/workflows/pr-automation.yml | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pr-automation.yml
b/.github/workflows/pr-automation.yml
index eff5215..3548c07 100644
--- a/.github/workflows/pr-automation.yml
+++ b/.github/workflows/pr-automation.yml
@@ -149,11 +149,20 @@ jobs:
toJSON(github.event.pull_request.labels) == '[]'
runs-on: ubuntu-latest
steps:
- - name: Check PR labels
- if: ${{ github.event_name == 'pull_request' &&
join(github.event.pull_request.labels.*.name) == '' }}
- run: |
- echo "::error::PRs must be labeled"
- exit 1
+ - name: Comment PR
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #
v7
+ with:
+ script: |
+
+ await github.rest.issues.createComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number,
+ body: '@' + context.payload.pull_request.merged_by.login +
+ ' Please assign appropriate label to PR according to the type of
change.'
+ });
+
+ throw new Error('PRs must be labeled');
# check PR assignee - if no one is assigned, assign to person who merge PR
assignees: