Skip to content

Commit cb1f91a

Browse files
committed
apacheGH-499: Require PR labels for changelog
1 parent b933d2e commit cb1f91a

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/dev_pr.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Dev PR
19+
20+
on:
21+
pull_request_target:
22+
types:
23+
- labeled
24+
- unlabeled
25+
- opened
26+
- edited
27+
- reopened
28+
- synchronize
29+
- ready_for_review
30+
- review_requested
31+
32+
concurrency:
33+
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
34+
cancel-in-progress: true
35+
36+
permissions:
37+
contents: read
38+
39+
jobs:
40+
pr-label:
41+
name: "Ensure PR is labeled"
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Ensure PR is labeled
45+
env:
46+
LABELS: ${{ toJson(github.pull_request.labels) }}
47+
run: |
48+
if ! echo $LABELS | jq -e '.[] | select(.name | IN("bug-fix", "dependencies", "enhancement")) | .name'; then
49+
echo "Label the PR with one or more of:"
50+
echo "- bug-fix"
51+
echo "- dependencies"
52+
echo "- enhancement"
53+
echo
54+
echo "Also, add 'breaking-change' if appropriate."
55+
exit 1
56+
else
57+
echo "Pull request is labeled properly!"
58+
fi

0 commit comments

Comments
 (0)