-
Notifications
You must be signed in to change notification settings - Fork 296
90 lines (83 loc) · 4.44 KB
/
on-issue-creation.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: On issue creation
on:
issues:
types:
- opened
jobs:
add-latest-version-comment-to-feature-request-issues:
name: Add latest version comment to feature request issues
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'feature request')
permissions:
issues: write
steps:
- uses: actions/checkout@v2
- name: Get latest version tag
id: get-latest-tag
uses: actions-ecosystem/action-get-latest-tag@v1
with:
semver_only: true
- name: Add latest version comment
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
uses: peter-evans/create-or-update-comment@5f728c3dae25f329afbe34ee4d08eef25569d79f
with:
issue-number: ${{ github.event.issue.number }}
body: >
The current version of Grafana OnCall, at the time this issue was opened,
is ${{ steps.get-latest-tag.outputs.tag }}. If your issue pertains to an older version of Grafana OnCall,
please be sure to list it in the PR description. Thank you :smile:!
add-needs-triage-label:
name: Add "needs triage" label
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add "needs triage" label
uses: actions-ecosystem/action-add-labels@v1
with:
labels: needs triage
map-selected-product-areas-to-labels-and-assignees:
name: Map selected product areas to labels and assignees
runs-on: ubuntu-latest
# try to avoid running this job for an issue that is created via a tasklist
# only run it for issues created via the bug or feature request issue templates
if: >
contains(github.event.issue.labels.*.name, 'bug') ||
contains(github.event.issue.labels.*.name, 'feature request')
permissions:
issues: write
steps:
- uses: actions/checkout@v2
- id: issue-form-values
uses: stefanbuck/github-issue-parser@v3
- run: echo $JSON_STRING
env:
JSON_STRING: ${{ steps.issue-form-values.outputs.jsonString }}
- name: Map mobile app product area to appropriate assignees
uses: actions-ecosystem/action-add-assignees@v1
if: contains(steps.issue-form-values.outputs.issueparser_product_area, 'Mobile App')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignees: |
imtoori
dieterbe
- name: Map selected product area(s) to issue labels
uses: actions-ecosystem/action-add-labels@v1
# github actions have a weird ternary operator, see below for more details
# https://docs.github.com/en/actions/learn-github-actions/expressions#literals:~:text=GitHub%20offers%20ternary%20operator%20like%20behaviour%20that%20you%20can%20use%20in%20expressions
with:
# yamllint disable rule:line-length
labels: |
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Alert Flow & Configuration') && 'part:alert flow & configuration' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Auth') && 'part:auth/teams' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Chatops') && 'part:chatops' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Mobile App') && 'part:mobile' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Schedules') && 'part:schedules' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'API') && 'part:API' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Metrics') && 'part:metrics/logging' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Terraform/Crossplane') && 'part:Terraform/Crossplane' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Helm/Kubernetes/Docker') && 'part:helm/kubernetes/docker' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'CI/CD') && 'part:ci/cd' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Other') && 'more info needed' || '' }}
# yamllint enable rule:line-length