Skip to content

Commit a8ce2ee

Browse files
committed
Updated JIRA workflow.
1 parent 9b3c119 commit a8ce2ee

File tree

1 file changed

+12
-57
lines changed

1 file changed

+12
-57
lines changed

.github/workflows/jira.yml

Lines changed: 12 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,18 @@
1+
name: Sync GitHub issues to Jira
12
on:
23
issues:
34
types:
45
- opened
56
- closed
6-
7-
name: Sync GitHub issues to Jira
8-
7+
permissions:
8+
issues: write
9+
pull-requests: read
910
jobs:
10-
open:
11-
if: github.event.action == 'opened'
12-
runs-on: ubuntu-22.04
13-
name: Create new tickets in Jira
14-
permissions:
15-
issues: write
16-
steps:
17-
- name: Login
18-
uses: acquia/gajira-login@bearer
19-
env:
20-
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
21-
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
22-
- name: Create
23-
id: create
24-
uses: acquia/gajira-create@bearer
25-
with:
26-
project: ACMS
27-
issuetype: Task
28-
summary: ${{ github.event.issue.title }}
29-
description: ${{ github.event.issue.html_url }}
30-
- name: Update Github issue with Jira ticket prefix
31-
run: 'gh issue edit $GH_ISSUE --title "$JIRA_ISSUE: $ISSUE_TITLE"'
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
GH_ISSUE: ${{ github.event.issue.html_url }}
35-
JIRA_ISSUE: ${{ steps.create.outputs.issue }}
36-
ISSUE_TITLE: ${{ github.event.issue.title }}
37-
close:
38-
if: github.event.action == 'closed'
39-
runs-on: ubuntu-22.04
40-
name: Comment in Jira
41-
permissions:
42-
issues: write
43-
steps:
44-
- name: Get Jira issue
45-
id: get-issue
46-
run: |
47-
if [[ "$ISSUE_TITLE" =~ ^(ACMS-[0-9]+): ]]; then
48-
echo "issue=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
49-
fi
50-
env:
51-
ISSUE_TITLE: ${{ github.event.issue.title }}
52-
- name: Login
53-
if: steps.get-issue.outputs.issue
54-
uses: acquia/gajira-login@bearer
55-
env:
56-
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
57-
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
58-
- name: Comment
59-
if: steps.get-issue.outputs.issue
60-
uses: acquia/gajira-comment@bearer
61-
with:
62-
issue: ${{ steps.get-issue.outputs.issue }}
63-
comment: The GitHub issue corresponding to this ticket has been closed
11+
jira:
12+
uses: acquia/.github/.github/workflows/jira.yml@main
13+
secrets:
14+
jira-user-email: ${{ secrets.JIRA_USER_EMAIL }}
15+
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
16+
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
with:
18+
project_key: 'ACMS'

0 commit comments

Comments
 (0)