-
Notifications
You must be signed in to change notification settings - Fork 649
53 lines (45 loc) · 1.53 KB
/
pull_request_open.yml
File metadata and controls
53 lines (45 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Pull Request Open
on:
pull_request_target:
branches:
- main
- 14.0.x
types:
- opened
- reopened
jobs:
updateJira:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract Jira Key
run: echo ISSUE_KEY=$(echo "${{ github.event.pull_request.title }}" | grep -oP 'ISPN-(?P<id>[0-9]+)') >> $GITHUB_ENV
- run: echo ${{ env.ISSUE_KEY }}
- run: echo "$ISSUE_KEY"
- name: Link Pull Request
if: ${{ env.ISSUE_KEY != '' }}
run: ./bin/jira/add_pull_request.sh
env:
ISSUE_KEY: ${{ env.ISSUE_KEY }}
PULL_REQUEST: ${{ github.event.pull_request.html_url }}
TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Transition Issue to Code Review
if: ${{ env.ISSUE_KEY != '' }}
run: ./bin/jira/transition.sh
env:
ISSUE_KEY: ${{ env.ISSUE_KEY }}
TOKEN: ${{ secrets.JIRA_API_TOKEN }}
TRANSITION: Code Review
- name: Set PR Milestone
id: milestone
run: |
sudo apt-get install xmlstarlet
MVN_VERSION=$(xmlstarlet sel -t -m _:project -v _:version pom.xml)
export MAJOR_VERSION=${MVN_VERSION%.*.*}
gh pr edit ${{ github.event.pull_request.number }} --milestone "$(./bin/jira/get_milestone.sh)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_KEY: ISPN
TOKEN: ${{ secrets.JIRA_API_TOKEN }}