From befcd3aa6bc9d09c6e8161f6589440694c4bc882 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 11:18:00 +0100 Subject: [PATCH 01/11] chore(ci): add workflow to link PRs to Jira tickets --- .github/workflows/jira-link-pr.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/jira-link-pr.yml diff --git a/.github/workflows/jira-link-pr.yml b/.github/workflows/jira-link-pr.yml new file mode 100644 index 00000000000..c9ddf150386 --- /dev/null +++ b/.github/workflows/jira-link-pr.yml @@ -0,0 +1,27 @@ +name: Link PR to Jira Ticket +on: + pull_request: + types: [opened, edited, synchronize] + +permissions: + contents: read + pull-requests: write + +jobs: + jira-link: + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'wireapp' }} + steps: + - name: Check for Dependabot + if: github.actor == 'dependabot[bot]' || github.actor == 'AndroidBob' + run: echo "PR created by Dependabot or AndroidBob, exiting successfully" && exit 0 + + - uses: cleartax/jira-lint@v1 + name: Validate and Link Jira Ticket + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + jira-token: ${{ secrets.JIRA_TOKEN }} + jira-base-url: https://wearezeta.atlassian.net + skip-branches: '^(production-release|main|master|release\/v\d+)$' + fail-on-error: true + skip-pr-update: true From 5f56e3b9fc499740f66c6a451e9bb24d0d39879a Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 11:19:39 +0100 Subject: [PATCH 02/11] remove old action --- .github/workflows/jira-lint-and-link.yml | 27 ------------------------ 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/jira-lint-and-link.yml diff --git a/.github/workflows/jira-lint-and-link.yml b/.github/workflows/jira-lint-and-link.yml deleted file mode 100644 index 5103c3f4c18..00000000000 --- a/.github/workflows/jira-lint-and-link.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Link and Lint PR with Jira Ticket Number -on: - merge_group: - pull_request: - types: [opened, edited, synchronize] - -permissions: - contents: read - pull-requests: write -jobs: - add-jira-description: - runs-on: ubuntu-latest - # Run only if the PR is not from a Fork / external contributor - if: ${{ github.repository_owner == 'wireapp' }} - steps: - - name: Check for Dependabot - if: github.actor == 'dependabot[bot]' || github.actor == 'AndroidBob' - run: echo "PR created by Dependabot or AndroidBob, exiting successfully" && exit 0 - - - uses: cakeinpanic/jira-description-action@v0.9.0 - name: jira-description-action - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - jira-token: ${{ secrets.JIRA_TOKEN }} - jira-base-url: https://wearezeta.atlassian.net - skip-branches: '^(production-release|main|master|release\/v\d+)$' #optional - fail-when-jira-issue-not-found: true From 14b38eaf5333aba3e7a8611b5db7860d00be7b4a Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 11:23:00 +0100 Subject: [PATCH 03/11] fix the action version --- .github/workflows/jira-link-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jira-link-pr.yml b/.github/workflows/jira-link-pr.yml index c9ddf150386..87b372e2339 100644 --- a/.github/workflows/jira-link-pr.yml +++ b/.github/workflows/jira-link-pr.yml @@ -16,7 +16,7 @@ jobs: if: github.actor == 'dependabot[bot]' || github.actor == 'AndroidBob' run: echo "PR created by Dependabot or AndroidBob, exiting successfully" && exit 0 - - uses: cleartax/jira-lint@v1 + - uses: cleartax/jira-lint@v0.0.1 name: Validate and Link Jira Ticket with: github-token: ${{ secrets.GITHUB_TOKEN }} From b65ffcd022c6350e50caf685ca5113554bb1c06d Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 11:27:43 +0100 Subject: [PATCH 04/11] chore(ci): update jira-lint action version and add PR threshold --- .github/workflows/jira-link-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/jira-link-pr.yml b/.github/workflows/jira-link-pr.yml index 87b372e2339..fc01af6804b 100644 --- a/.github/workflows/jira-link-pr.yml +++ b/.github/workflows/jira-link-pr.yml @@ -25,3 +25,4 @@ jobs: skip-branches: '^(production-release|main|master|release\/v\d+)$' fail-on-error: true skip-pr-update: true + pr-threshold: 1 From cd75ac511ccba799088037912c8c6a1a2bac4513 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 11:34:25 +0100 Subject: [PATCH 05/11] chore(ci): update Jira linking workflow to extract ticket ID and create remote link --- .github/workflows/jira-link-pr.yml | 44 ++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/jira-link-pr.yml b/.github/workflows/jira-link-pr.yml index fc01af6804b..06231aa979e 100644 --- a/.github/workflows/jira-link-pr.yml +++ b/.github/workflows/jira-link-pr.yml @@ -5,7 +5,7 @@ on: permissions: contents: read - pull-requests: write + pull-requests: read jobs: jira-link: @@ -16,13 +16,35 @@ jobs: if: github.actor == 'dependabot[bot]' || github.actor == 'AndroidBob' run: echo "PR created by Dependabot or AndroidBob, exiting successfully" && exit 0 - - uses: cleartax/jira-lint@v0.0.1 - name: Validate and Link Jira Ticket - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - jira-token: ${{ secrets.JIRA_TOKEN }} - jira-base-url: https://wearezeta.atlassian.net - skip-branches: '^(production-release|main|master|release\/v\d+)$' - fail-on-error: true - skip-pr-update: true - pr-threshold: 1 + - name: Extract Jira ticket and create remote link + env: + JIRA_BASE_URL: https://wearezeta.atlassian.net + JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }} + PR_TITLE: ${{ github.event.pull_request.title }} + PR_URL: ${{ github.event.pull_request.html_url }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPO_NAME: ${{ github.repository }} + run: | + # Extract Jira ticket ID from PR title (matches WPB-12345, SQPIT-123, etc.) + JIRA_KEY=$(echo "$PR_TITLE" | grep -oE '[A-Z]+-[0-9]+' | head -n 1) + + if [ -z "$JIRA_KEY" ]; then + echo "No Jira ticket found in PR title: $PR_TITLE" + exit 0 + fi + + echo "Found Jira ticket: $JIRA_KEY" + + # Create remote link in Jira + curl -X POST \ + -H "Authorization: Bearer $JIRA_TOKEN" \ + -H "Content-Type: application/json" \ + "${JIRA_BASE_URL}/rest/api/3/issue/${JIRA_KEY}/remotelink" \ + -d "{ + \"object\": { + \"url\": \"${PR_URL}\", + \"title\": \"PR #${PR_NUMBER}: ${PR_TITLE}\" + } + }" + + echo "Remote link created successfully for $JIRA_KEY" From e80935aee21dd5a8f1e560971de5882558aa55e6 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 12:19:00 +0100 Subject: [PATCH 06/11] chore(ci): use reusable action --- .github/workflows/jira-link-pr.yml | 50 ++++++------------------------ 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/.github/workflows/jira-link-pr.yml b/.github/workflows/jira-link-pr.yml index 06231aa979e..55c5aea162f 100644 --- a/.github/workflows/jira-link-pr.yml +++ b/.github/workflows/jira-link-pr.yml @@ -8,43 +8,13 @@ permissions: pull-requests: read jobs: - jira-link: - runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'wireapp' }} - steps: - - name: Check for Dependabot - if: github.actor == 'dependabot[bot]' || github.actor == 'AndroidBob' - run: echo "PR created by Dependabot or AndroidBob, exiting successfully" && exit 0 - - - name: Extract Jira ticket and create remote link - env: - JIRA_BASE_URL: https://wearezeta.atlassian.net - JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }} - PR_TITLE: ${{ github.event.pull_request.title }} - PR_URL: ${{ github.event.pull_request.html_url }} - PR_NUMBER: ${{ github.event.pull_request.number }} - REPO_NAME: ${{ github.repository }} - run: | - # Extract Jira ticket ID from PR title (matches WPB-12345, SQPIT-123, etc.) - JIRA_KEY=$(echo "$PR_TITLE" | grep -oE '[A-Z]+-[0-9]+' | head -n 1) - - if [ -z "$JIRA_KEY" ]; then - echo "No Jira ticket found in PR title: $PR_TITLE" - exit 0 - fi - - echo "Found Jira ticket: $JIRA_KEY" - - # Create remote link in Jira - curl -X POST \ - -H "Authorization: Bearer $JIRA_TOKEN" \ - -H "Content-Type: application/json" \ - "${JIRA_BASE_URL}/rest/api/3/issue/${JIRA_KEY}/remotelink" \ - -d "{ - \"object\": { - \"url\": \"${PR_URL}\", - \"title\": \"PR #${PR_NUMBER}: ${PR_TITLE}\" - } - }" - - echo "Remote link created successfully for $JIRA_KEY" + link-jira: + uses: wireapp/.github/.github/workflows/jira-link-pr-reusable.yml@mo/ci/jira-linking-gh-action + with: + jira-base-url: https://wearezeta.atlassian.net + jira-ticket-regex: '[A-Z]+-[0-9]+' + skip-actors: 'dependabot[bot],AndroidBob' + skip-branches: '^(production-release|main|master|release\/v\d+)$' + repository-owner-check: 'wireapp' + secrets: + jira-token: ${{ secrets.JIRA_TOKEN }} From 0b8e66f41a3e562fad0f75c1cf08916f130de430 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 12:44:29 +0100 Subject: [PATCH 07/11] disable action --- .github/workflows/{jira-link-pr.yml => jira-link-pr.yml-disabled} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{jira-link-pr.yml => jira-link-pr.yml-disabled} (100%) diff --git a/.github/workflows/jira-link-pr.yml b/.github/workflows/jira-link-pr.yml-disabled similarity index 100% rename from .github/workflows/jira-link-pr.yml rename to .github/workflows/jira-link-pr.yml-disabled From 25e3e3817bdbd3b1fa9ebe0f533afabf1ecc0860 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 13:39:15 +0100 Subject: [PATCH 08/11] use a forked action --- .../workflows/{jira-link-pr.yml-disabled => jira-link-pr.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{jira-link-pr.yml-disabled => jira-link-pr.yml} (83%) diff --git a/.github/workflows/jira-link-pr.yml-disabled b/.github/workflows/jira-link-pr.yml similarity index 83% rename from .github/workflows/jira-link-pr.yml-disabled rename to .github/workflows/jira-link-pr.yml index 55c5aea162f..b8dfc4d1f18 100644 --- a/.github/workflows/jira-link-pr.yml-disabled +++ b/.github/workflows/jira-link-pr.yml @@ -9,7 +9,7 @@ permissions: jobs: link-jira: - uses: wireapp/.github/.github/workflows/jira-link-pr-reusable.yml@mo/ci/jira-linking-gh-action + uses: mohamadjaara/jira-description-action@master with: jira-base-url: https://wearezeta.atlassian.net jira-ticket-regex: '[A-Z]+-[0-9]+' From 4ce969e1a988a67502caa46ab2eb733187e7e4f5 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 13:41:18 +0100 Subject: [PATCH 09/11] use a forked action --- .github/workflows/{jira-link-pr.yml => jira-link-pr.yml-disabled} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{jira-link-pr.yml => jira-link-pr.yml-disabled} (100%) diff --git a/.github/workflows/jira-link-pr.yml b/.github/workflows/jira-link-pr.yml-disabled similarity index 100% rename from .github/workflows/jira-link-pr.yml rename to .github/workflows/jira-link-pr.yml-disabled From ad8fdd2dfd0878bc113bbec6f41992256d906089 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 13:41:23 +0100 Subject: [PATCH 10/11] use a forked action --- .github/workflows/jira-lint-and-link.yml | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/jira-lint-and-link.yml diff --git a/.github/workflows/jira-lint-and-link.yml b/.github/workflows/jira-lint-and-link.yml new file mode 100644 index 00000000000..9ce4301604f --- /dev/null +++ b/.github/workflows/jira-lint-and-link.yml @@ -0,0 +1,27 @@ +name: Link and Lint PR with Jira Ticket Number +on: + merge_group: + pull_request: + types: [opened, edited, synchronize] + +permissions: + contents: read + pull-requests: write +jobs: + add-jira-description: + runs-on: ubuntu-latest + # Run only if the PR is not from a Fork / external contributor + if: ${{ github.repository_owner == 'wireapp' }} + steps: + - name: Check for Dependabot + if: github.actor == 'dependabot[bot]' || github.actor == 'AndroidBob' + run: echo "PR created by Dependabot or AndroidBob, exiting successfully" && exit 0 + + - uses: mohamadjaara/jira-description-action@master + name: jira-description-action + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + jira-token: ${{ secrets.JIRA_TOKEN }} + jira-base-url: https://wearezeta.atlassian.net + skip-branches: '^(production-release|main|master|release\/v\d+)$' #optional + fail-when-jira-issue-not-found: true From b9169864689814c5d4bd2480a7fcf39011ecc000 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Thu, 13 Nov 2025 13:43:21 +0100 Subject: [PATCH 11/11] skip-ticket-title --- .github/workflows/jira-lint-and-link.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/jira-lint-and-link.yml b/.github/workflows/jira-lint-and-link.yml index 9ce4301604f..f102f1375e9 100644 --- a/.github/workflows/jira-lint-and-link.yml +++ b/.github/workflows/jira-lint-and-link.yml @@ -25,3 +25,4 @@ jobs: jira-base-url: https://wearezeta.atlassian.net skip-branches: '^(production-release|main|master|release\/v\d+)$' #optional fail-when-jira-issue-not-found: true + skip-ticket-title: tue