From e32da3ff9aa0d8fdb739c6533d0d231288a22f00 Mon Sep 17 00:00:00 2001 From: Raksha Bharuka Date: Tue, 19 Nov 2024 19:28:31 +0530 Subject: [PATCH 1/5] added new action to create jira ticket for dependabot PRs --- .github/workflows/dependabot.yml | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/dependabot.yml diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 00000000..63450f1e --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,45 @@ +name: Create JIRA Issue from Dependabot PR + +on: + pull_request: + types: [ opened, reopened ] + +jobs: + create_jira_issue: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Login + uses: atlassian/gajira-login@v3 + env: + JIRA_BASE_URL: ${{ vars.JIRA_BASE_URL }} + JIRA_USER_EMAIL: ${{ secrets.jira-user-email }} + JIRA_API_TOKEN: ${{ secrets.jira-api-token }} + + - name: Create JIRA Issue + uses: atlassian/gajira-create@v3 + with: + summary: "Dependabot PR: ${{ github.event.pull_request.title }}" + description: | + A new dependabot pull request has been created. + - **Branch**: ${{ github.event.pull_request.head.ref }} + - **PR Link**: ${{ github.event.pull_request.html_url }} + + issuetype: 'Task' + project: 'RCAT' + - name: Add Comment to PR with JIRA Issue + uses: actions/github-script@v6 + with: + script: | + const issueKey = context.payload.pull_request.title.match(/([A-Z]+-\d+)/); + const jiraIssueUrl = `https://${process.env.JIRA_BASE_URL}/browse/${issueKey}`; + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `JIRA Issue created: [${issueKey}](${jiraIssueUrl})`, + }); \ No newline at end of file From 1ab17d62de943041f9d31bbfbdf2a00e3de11510 Mon Sep 17 00:00:00 2001 From: Raksha Bharuka Date: Tue, 19 Nov 2024 21:12:19 +0530 Subject: [PATCH 2/5] added new action to create jira ticket for dependabot PRs --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2181b40c..301c69a3 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "symfony/phpunit-bridge": "^7.0.1", "symfony/process": "^6.4.2", "symfony/yaml": "^6.3.0", - "weitzman/drupal-test-traits": "^2.1" + "weitzman/drupal-test-traits": "^1.6" }, "require-dev": { "brainmaestro/composer-git-hooks": "^2.8.5", From dd570b236d344ca3acd1db183f88927cdbe77d2a Mon Sep 17 00:00:00 2001 From: Raksha Bharuka Date: Tue, 19 Nov 2024 21:24:18 +0530 Subject: [PATCH 3/5] added new action to create jira ticket for dependabot PRs --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bc3ab5c1..2f735c1c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,4 @@ updates: directory: "/" schedule: interval: "daily" + open-pull-requests-limit: 10 \ No newline at end of file From 2afb9cc51f41b3974828e772d4729d65c5073015 Mon Sep 17 00:00:00 2001 From: Raksha Bharuka Date: Thu, 21 Nov 2024 12:19:20 +0530 Subject: [PATCH 4/5] added new action to create jira ticket for dependabot PRs --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2f735c1c..803461a2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,4 +4,4 @@ updates: directory: "/" schedule: interval: "daily" - open-pull-requests-limit: 10 \ No newline at end of file + open-pull-requests-limit: 7 \ No newline at end of file From 4e7b6d2dcb1dc3b1eaa92e0f7c7b1ad41f93d939 Mon Sep 17 00:00:00 2001 From: Raksha Bharuka Date: Thu, 21 Nov 2024 12:24:46 +0530 Subject: [PATCH 5/5] added new action to create jira ticket for dependabot PRs --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 301c69a3..2181b40c 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "symfony/phpunit-bridge": "^7.0.1", "symfony/process": "^6.4.2", "symfony/yaml": "^6.3.0", - "weitzman/drupal-test-traits": "^1.6" + "weitzman/drupal-test-traits": "^2.1" }, "require-dev": { "brainmaestro/composer-git-hooks": "^2.8.5",