-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (46 loc) · 2.21 KB
/
add-GHrequest-to-team-board.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
# This workflow runs when a ticket is created.
# It adds the github-request label, tags on-call, and posts in Axim's internal slack channel.
#
# Separately, Axim's project board (https://github.com/orgs/openedx/projects/8)
# automatically adds all issues from this repo.
name: Label, tag, and notify on-call
on:
issues:
types: [opened]
env:
ORGANIZATION: openedx
jobs:
# Add a label to all issues that don't have it already (the template adds it automatically...
# but only if the requester has triage access on this repo).
# TODO: We used to add this label only to issues which were created from the on-call template.
# Since May 2024, we only use this repo for on-call issues, so we just add the label to everything.
# Once we've cleaned out our backlog of non-oncall issues from this repo, we can phase out
# this label entirely.
add_label:
runs-on: ubuntu-latest
# This is defined on all 2 jobs - so need to change x2 if changing this.
if: ${{ !contains(github.event.issue.labels.*.name, 'github-request') }}
steps:
- name: apply github-request label
uses: actions-ecosystem/action-add-labels@v1
with:
labels: github-request
# TODO: We could probably do this with CODEOWNERS and some premade GitHub<->Slack integration.
tag_and_notify:
runs-on: ubuntu-latest
steps:
- run: gh issue comment $ISSUE --body "Thank you for your report! @openedx/axim-oncall will triage within a business day. Simple requests usually take 2-3 business days to resolve; more complex requests could take longer."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE: ${{ github.event.issue.html_url }}
- name: Send custom JSON data to Slack workflow
id: slack
uses: slackapi/[email protected]
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"msg": "${{ github.event.issue.title }}\nAuthor: ${{ github.event.issue.user.login }}\nURL: https://www.github.com/openedx/axim-engineering/issues/${{ github.event.issue.number }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}