-
Notifications
You must be signed in to change notification settings - Fork 20
41 lines (35 loc) · 1.04 KB
/
jira-close.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
name: Jira closure
on:
issues:
types: [closed, deleted]
permissions:
issues: write
jobs:
close-issue:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: snowflakedb/gh-actions
ref: jira_v1
token: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }}
path: .
- name: Jira login
uses: atlassian/gajira-login@master
env:
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
- name: Extract issue from title
id: extract
env:
TITLE: "${{ github.event.issue.title }}"
run: |
jira=$(echo -n $TITLE | awk '{print $1}' | sed -e 's/://')
echo ::set-output name=jira::$jira
- name: Close issue
uses: ./jira/gajira-close
if: startsWith(steps.extract.outputs.jira, 'SNOW-')
with:
issue: "${{ steps.extract.outputs.jira }}"