From 2e1768ebf08616ce8a990212af2574cfe5235a41 Mon Sep 17 00:00:00 2001 From: Rushi Vishavadia Date: Mon, 26 Feb 2024 10:18:41 +0530 Subject: [PATCH] Workflows to link JIRA tickets --- .github/workflows/link-jira-tools.yml | 45 +++++++++++++++++++++++++++ .github/workflows/link-jira-x2.yml | 45 +++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .github/workflows/link-jira-tools.yml create mode 100644 .github/workflows/link-jira-x2.yml diff --git a/.github/workflows/link-jira-tools.yml b/.github/workflows/link-jira-tools.yml new file mode 100644 index 000000000..b4594746b --- /dev/null +++ b/.github/workflows/link-jira-tools.yml @@ -0,0 +1,45 @@ +name: Link TOOLS Ticket to PR + # URL: https://github.com/marketplace/actions/add-jira-info-to-pull-request#how-to-get-the-jira-token-and-jira-username + # The following formats will work: + # PRJ-1234-some-short-description + # feature/PRJ-1234_some-short-description + # some-short-description_PRJ-1234 +# feature/some-short-description_PRJ-1234 +# feature/PRJ-1234_some-short-description + +on: + pull_request: + types: + - opened + - synchronize + - reopened + workflow_dispatch: + +permissions: + contents: read + pull-requests: write + +jobs: + automation: + runs-on: ubuntu-latest + steps: + - name: Generate a token + id: generate_token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.XOLA_GITHUB_APP_ID }} + private_key: ${{ secrets.XOLA_GITHUB_APP_PRIVATE_KEY }} + + - name: Add Jira info + uses: contractify/add-jira-info@v1 + with: + github-token: ${{ steps.generate_token.outputs.token }} + jira-base-url: https://xola01.atlassian.net/ + jira-username: rushi@xola.com + jira-token: ${{ secrets.RUSHI_JIRA_API_KEY }} + jira-project-key: TOOLS + add-label-with-issue-type: true + issue-type-label-color: FBCA04 + issue-type-label-description: 'Jira Issue Type' + add-jira-key-to-title: true + add-jira-key-to-body: true diff --git a/.github/workflows/link-jira-x2.yml b/.github/workflows/link-jira-x2.yml new file mode 100644 index 000000000..2e0105b1a --- /dev/null +++ b/.github/workflows/link-jira-x2.yml @@ -0,0 +1,45 @@ +name: Link X2 Ticket to PR + # URL: https://github.com/marketplace/actions/add-jira-info-to-pull-request#how-to-get-the-jira-token-and-jira-username + # The following formats will work: + # PRJ-1234-some-short-description + # feature/PRJ-1234_some-short-description + # some-short-description_PRJ-1234 + # feature/some-short-description_PRJ-1234 +# feature/PRJ-1234_some-short-description + +on: + pull_request: + types: + - opened + - synchronize + - reopened + workflow_dispatch: + +permissions: + contents: read + pull-requests: write + +jobs: + automation: + runs-on: ubuntu-latest + steps: + - name: Generate a token + id: generate_token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.XOLA_GITHUB_APP_ID }} + private_key: ${{ secrets.XOLA_GITHUB_APP_PRIVATE_KEY }} + + - name: Add Jira info + uses: contractify/add-jira-info@v1 + with: + github-token: ${{ steps.generate_token.outputs.token }} + jira-base-url: https://xola01.atlassian.net/ + jira-username: rushi@xola.com + jira-token: ${{ secrets.RUSHI_JIRA_API_KEY }} + jira-project-key: X2 + add-label-with-issue-type: true + issue-type-label-color: FBCA04 + issue-type-label-description: 'Jira Issue Type' + add-jira-key-to-title: true + add-jira-key-to-body: true