-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
48 lines (48 loc) · 1.38 KB
/
action.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
name: Release to JIRA
description: A GitHub action to automatically create releases on JIRA.
author: ulasozguler
branding:
icon: 'edit'
color: 'blue'
inputs:
jira_server:
description: JIRA server
required: true
jira_project:
description: JIRA project
required: true
jira_user:
description: JIRA user
required: true
jira_token:
description: JIRA user token
required: true
runs:
using: composite
steps:
- uses: actions/checkout@v3
- name: Get or create Github release
shell: bash
working-directory: ${{ github.action_path }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api \
--method GET /repos/${{ github.repository }}/releases/tags/${{ github.ref_name }} \
--jq .body > notes.md \
|| \
gh api \
--method POST /repos/${{ github.repository }}/releases \
-f tag_name='${{ github.ref_name }}' \
-f name='${{ github.ref_name }}' \
-F generate_release_notes=true \
--jq .body > notes.md
- name: Update JIRA
shell: bash
working-directory: ${{ github.action_path }}
env:
INPUT_JIRA_SERVER: ${{ inputs.jira_server }}
INPUT_JIRA_PROJECT: ${{ inputs.jira_project }}
INPUT_JIRA_USER: ${{ inputs.jira_user }}
INPUT_JIRA_TOKEN: ${{ inputs.jira_token }}
run: python ./src/main.py