-
Notifications
You must be signed in to change notification settings - Fork 473
50 lines (45 loc) · 1.74 KB
/
jira_issue.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Jira creation
on:
issues:
types: [opened]
issue_comment:
types: [created]
jobs:
create-issue:
runs-on: ubuntu-latest
permissions:
issues: write
if: ((github.event_name == 'issue_comment' && github.event.comment.body == 'recreate jira' && github.event.comment.user.login == 'sfc-gh-mkeller') || (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]'))
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: snowflakedb/gh-actions
ref: jira_v1
token: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} # stored in GitHub secrets
path: .
- name: Login
uses: atlassian/[email protected]
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Create JIRA Ticket
id: create
uses: atlassian/[email protected]
with:
project: SNOW
issuetype: Bug
summary: '${{ github.event.issue.title }}'
description: |
${{ github.event.issue.body }} \\ \\ _Created from GitHub Action_ for ${{ github.event.issue.html_url }}
fields: '{"customfield_11401":{"id":"14586"},"assignee":{"id":"61027a237ab143006ecfb9a2"},"components":[{"id":"16413"}]}'
- name: Update GitHub Issue
uses: ./jira/gajira-issue-update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
issue_number: "{{ event.issue.id }}"
owner: "{{ event.repository.owner.login }}"
name: "{{ event.repository.name }}"
jira: "${{ steps.create.outputs.issue }}"