File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Ensure GH PRs have a corresponding JIRA issue
2
+
3
+ on :
4
+ pull_request :
5
+ types : [opened, edited]
6
+
7
+ jobs :
8
+ permissions :
9
+ contents : read
10
+ pull-requests : write
11
+ validate-url :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Check for required URI pattern
15
+ id : check_uri
16
+ env :
17
+ PR_BODY : ${{ github.event.pull_request.body }}
18
+ URIPAT : " https://issues.redhat.com/browse/OPENJDK-"
19
+ run : |
20
+ if echo "$PR_BODY" | grep -q "$URIPAT"; then
21
+ echo "missing=false" >> $GITHUB_OUTPUT
22
+ else
23
+ echo "missing=true" >> $GITHUB_OUTPUT
24
+ fi
25
+
26
+ - name : Apply label if URI missing
27
+ if : steps.check_uri.outputs.missing == 'true'
28
+ uses : actions-ecosystem/action-add-labels@v1
29
+ with :
30
+ labels : " needs-jira-issue"
31
+
32
+ - name : Remove label if URI present
33
+ if : steps.check_uri.outputs.missing == 'false'
34
+ uses : actions-ecosystem/action-remove-labels@v1
35
+ with :
36
+ labels : " needs-jira-issue"
37
+
You can’t perform that action at this time.
0 commit comments