|
12 | 12 |
|
13 | 13 | jobs: |
14 | 14 | jira: |
15 | | - if: github.actor == 'dependabot[bot]' && !contains(github.event.pull_request.labels.*.name, 'github_actions') && startsWith(github.event.pull_request.title, 'Bump') |
| 15 | + if: github.actor == 'dependabot[bot]' |
16 | 16 | runs-on: ubuntu-latest |
17 | 17 | permissions: |
18 | 18 | contents: write |
|
21 | 21 | - name: Checkout repository |
22 | 22 | uses: actions/checkout@v4 |
23 | 23 |
|
24 | | - - name: Checkout repository |
25 | | - uses: actions/checkout@v4 |
26 | | - with: |
27 | | - ref: main |
28 | | - repository: infinispan/infinispan |
29 | | - path: infinispan |
30 | | - |
31 | | - # Explicitly set the default repository as it will be infinispan/infinispan due to the previous checkout step |
32 | | - - run: | |
33 | | - git remote add protostream git@github.com:infinispan/protostream.git |
34 | | - gh repo set-default infinispan/protostream |
35 | | - env: |
36 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
37 | | -
|
38 | | - - name: Jira Summary |
39 | | - run: echo SUMMARY=$(echo "${PR_TITLE}" | grep -oP '(?<=Bump )(.*)(?=from)|(?<=to )(.*)' | tr -d '\n') >> $GITHUB_ENV |
40 | | - env: |
41 | | - PR_TITLE: ${{ github.event.pull_request.title }} |
42 | | - |
43 | | - - name: Create or Update Existing Jira |
44 | | - run: | |
45 | | - source ./infinispan/bin/jira/upsert.sh |
46 | | - echo "JIRA_ISSUE_KEY=${JIRA_ISSUE_KEY}" >> $GITHUB_ENV |
47 | | - echo "JIRA_ISSUE_URL=${JIRA_ISSUE_URL}" >> $GITHUB_ENV |
48 | | - env: |
49 | | - ASSIGNEE: infinispan-bot |
50 | | - PROJECT_KEY: IPROTO |
51 | | - PULL_REQUEST: ${{ github.event.pull_request.html_url }} |
52 | | - SUMMARY: ${{ env.SUMMARY }} |
53 | | - TOKEN: ${{ secrets.JIRA_API_TOKEN }} |
54 | | - TYPE: Component Upgrade |
55 | | - RUNNER_DEBUG: "1" |
56 | | - |
57 | | - - name: Add comment to PR |
58 | | - run: gh pr comment ${{ github.event.pull_request.number }} --body ${{ env.JIRA_ISSUE_URL }} |
| 24 | + - name: Approve PR for auto-merge |
| 25 | + run: gh pr merge --auto --rebase ${{ github.event.pull_request.number }} |
59 | 26 | env: |
60 | 27 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
61 | | - |
62 | | - - name: Update PR Title main |
63 | | - if: ${{ github.base_ref == 'main' }} |
64 | | - run: gh pr edit ${{ github.event.pull_request.number }} --title "${{ env.JIRA_ISSUE_KEY }} ${{ github.event.pull_request.title }}" |
65 | | - env: |
66 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
67 | | - |
68 | | - - name: Update PR Title |
69 | | - if: startsWith(github.event.pull_request.title, 'Bump') |
70 | | - run: gh pr edit ${{ github.event.pull_request.number }} --title "${{ env.JIRA_ISSUE_KEY }} ${{ github.event.pull_request.title }}" |
71 | | - env: |
72 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
73 | | - |
74 | | - - name: Set PR Milestone |
75 | | - id: milestone |
76 | | - run: | |
77 | | - sudo apt-get install xmlstarlet |
78 | | - MVN_VERSION=$(xmlstarlet sel -t -m _:project -v _:version pom.xml) |
79 | | - export MAJOR_MINOR_VERSION=${MVN_VERSION%.*} |
80 | | - gh pr edit ${{ github.event.pull_request.number }} --milestone "$(./infinispan/bin/jira/get_milestone.sh)" |
81 | | - env: |
82 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
83 | | - PROJECT_KEY: IPROTO |
84 | | - TOKEN: ${{ secrets.JIRA_API_TOKEN }} |
85 | | - |
86 | | -# - name: Approve PR for auto-merge |
87 | | -# run: gh pr merge --auto --rebase ${{ github.event.pull_request.number }} |
88 | | -# env: |
89 | | -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments