From b32ee00209a1a5f0075fcb571e73ea884fdb5366 Mon Sep 17 00:00:00 2001 From: Ryan Emerson Date: Wed, 4 Dec 2024 10:12:48 +0000 Subject: [PATCH] Remove Dependabot Jira integration Closes #375 --- .github/workflows/dependabot_pull_request.yml | 68 +------------------ 1 file changed, 3 insertions(+), 65 deletions(-) diff --git a/.github/workflows/dependabot_pull_request.yml b/.github/workflows/dependabot_pull_request.yml index 6429fd664..0d5359241 100644 --- a/.github/workflows/dependabot_pull_request.yml +++ b/.github/workflows/dependabot_pull_request.yml @@ -12,7 +12,7 @@ on: jobs: jira: - if: github.actor == 'dependabot[bot]' && !contains(github.event.pull_request.labels.*.name, 'github_actions') && startsWith(github.event.pull_request.title, 'Bump') + if: github.actor == 'dependabot[bot]' runs-on: ubuntu-latest permissions: contents: write @@ -21,69 +21,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: main - repository: infinispan/infinispan - path: infinispan - - # Explicitly set the default repository as it will be infinispan/infinispan due to the previous checkout step - - run: | - git remote add protostream git@github.com:infinispan/protostream.git - gh repo set-default infinispan/protostream - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Jira Summary - run: echo SUMMARY=$(echo "${PR_TITLE}" | grep -oP '(?<=Bump )(.*)(?=from)|(?<=to )(.*)' | tr -d '\n') >> $GITHUB_ENV - env: - PR_TITLE: ${{ github.event.pull_request.title }} - - - name: Create or Update Existing Jira - run: | - source ./infinispan/bin/jira/upsert.sh - echo "JIRA_ISSUE_KEY=${JIRA_ISSUE_KEY}" >> $GITHUB_ENV - echo "JIRA_ISSUE_URL=${JIRA_ISSUE_URL}" >> $GITHUB_ENV - env: - ASSIGNEE: infinispan-bot - PROJECT_KEY: IPROTO - PULL_REQUEST: ${{ github.event.pull_request.html_url }} - SUMMARY: ${{ env.SUMMARY }} - TOKEN: ${{ secrets.JIRA_API_TOKEN }} - TYPE: Component Upgrade - RUNNER_DEBUG: "1" - - - name: Add comment to PR - run: gh pr comment ${{ github.event.pull_request.number }} --body ${{ env.JIRA_ISSUE_URL }} + - name: Approve PR for auto-merge + run: gh pr merge --auto --rebase ${{ github.event.pull_request.number }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update PR Title main - if: ${{ github.base_ref == 'main' }} - run: gh pr edit ${{ github.event.pull_request.number }} --title "${{ env.JIRA_ISSUE_KEY }} ${{ github.event.pull_request.title }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update PR Title - if: startsWith(github.event.pull_request.title, 'Bump') - run: gh pr edit ${{ github.event.pull_request.number }} --title "${{ env.JIRA_ISSUE_KEY }} ${{ github.event.pull_request.title }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - 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_MINOR_VERSION=${MVN_VERSION%.*} - gh pr edit ${{ github.event.pull_request.number }} --milestone "$(./infinispan/bin/jira/get_milestone.sh)" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PROJECT_KEY: IPROTO - TOKEN: ${{ secrets.JIRA_API_TOKEN }} - -# - name: Approve PR for auto-merge -# run: gh pr merge --auto --rebase ${{ github.event.pull_request.number }} -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}