Skip to content

Commit

Permalink
Create JIRA Issue from Dependabot PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Raksha-Bharuka committed Nov 21, 2024
1 parent bf8e494 commit 43cce70
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
create_jira_issue:
# if: github.actor == 'dependabot[bot]'
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest

steps:
Expand All @@ -31,16 +31,3 @@ jobs:
- **Branch**: ${{ github.event.pull_request.head.ref }}
- **PR Link**: ${{ github.event.pull_request.html_url }}
- **Author**: ${{ github.actor }}
- 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})`,
});

0 comments on commit 43cce70

Please sign in to comment.