From 9dd0a630d03872d922233f537c69cd3be83b3a43 Mon Sep 17 00:00:00 2001 From: MazOneTwoOne <76905544+MazOneTwoOne@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:16:34 +0100 Subject: [PATCH] WIP: - set-up gajira --- .github/workflows/gajira.yml | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/gajira.yml diff --git a/.github/workflows/gajira.yml b/.github/workflows/gajira.yml new file mode 100644 index 000000000..44a603bf7 --- /dev/null +++ b/.github/workflows/gajira.yml @@ -0,0 +1,37 @@ +name: Raise Dependabot Jira Issue + +on: + pull_request: + types: [opened] + +jobs: + gajira: + name: Raise Jira Issue + runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels, 'dependencies') }} + steps: + - name: Login + uses: atlassian/gajira-login@master + env: + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + + - name: Process PR data + id: process_pr_data + run: | + repo_name=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f2 | sed 's/ *(.*)//') + pr_body="${{ github.event.pull_request.body }}" + stripped_body=$(echo "$pr_body" | sed 's/<[^>]*>//g') + + echo "repo_name=$repo_name" >> $GITHUB_ENV + echo "stripped_body=$stripped_body" >> $GITHUB_ENV + + - name: Create Jira ticket + id: create + uses: atlassian/gajira-create@master + with: + project: EL + issuetype: Task + summary: "Dependabot: - ${{ env.repo_name }} - ${{ github.event.pull_request.title }}" + description: ${{ env.stripped_body }} \ No newline at end of file