-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (50 loc) · 1.81 KB
/
issues.yaml
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
51
52
53
name: Issues
on: [issues]
jobs:
update:
name: Update Issue
runs-on: ubuntu-latest
steps:
- name: Dump Github Context
run: |
echo "update=false" >> $GITHUB_ENV
if [ ${{ github.event_name }} != "issues" ]; then
echo "This action only operates on issues"
exit 0
fi
echo "update=true" >> $GITHUB_ENV
- name: Determine action
run: |
if [ ${{ github.event.action }} == "opened" ]; then
echo "action=open" >> $GITHUB_ENV
fi
if [ ${{ github.event.action }} == "reopened" ]; then
echo "action=reopen" >> $GITHUB_ENV
fi
if [ ${{ github.event.action }} == "closed" ]; then
echo "action=close" >> $GITHUB_ENV
fi
- name: Determine type
run: |
if ${{ contains(github.event.*.labels.*.name, 'Type: Bug') }}; then
echo "type=bug" >> $GITHUB_ENV
else
echo "type=story" >> $GITHUB_ENV
fi
- name: Update
if: ${{ env.update == 'true' }}
env:
ID: ${{ github.event.issue.html_url }}
TITLE: ${{github.event.issue.title }}
COMPONENT: prometheus
DESCRIPTION: Opened by ${{ github.event.issue.user.login }}.
run: |
data=$(jq -n \
--arg id "$ID" \
--arg action "${{ env.action }}" \
--arg title "$TITLE" \
--arg description "$DESCRIPTION" \
--arg component "$COMPONENT" \
--arg type "${{ env.type }}" \
'{data: {id: $id, action: $action, title: $title, description: $description, component: $component, type: $type}}')
curl -X POST -H 'Content-type: application/json' --data "${data}" "${{ secrets.JIRA_URL }}"