-
Notifications
You must be signed in to change notification settings - Fork 44
57 lines (53 loc) · 1.88 KB
/
issues.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
name: Issues Automation
on:
issues:
types: [opened, edited, deleted, closed, reopened, labeled, unlabeled, assigned]
concurrency:
group: issue-${{ github.event.issue.number }}
cancel-in-progress: false
jobs:
customer:
name: Add a label if Issue created by customer
if: github.event.action == 'opened'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_RAD_CI_BOT_PAT }}
steps:
- name: Add label if author in preview team
env:
ISSUE: ${{ github.event.issue.html_url }}
AUTHOR: ${{ github.actor }}
run: |
MEMBERS=$(gh api orgs/project-radius/teams/Radius-Preview/members | jq -r '.[] | .login')
ADMINS=$(gh api orgs/project-radius/teams/Radius-Admin/members | jq -r '.[] | .login')
for USER in $MEMBERS; do
if [[ "$USER" == "$AUTHOR" ]]; then
ISADMIN=false
for ADMIN in $ADMINS; do
if [[ "$USER" == "$ADMIN" ]]; then
echo "$USER is an admin, skipping"
ISADMIN=true
fi
done
if [[ "$ISADMIN" == "false" ]]; then
echo "Adding label for issue $ISSUE"
gh issue edit $ISSUE --add-label "customer-issue"
fi
fi
done
ado:
name: Sync issue to Azure DevOps
runs-on: ubuntu-latest
steps:
- uses: danhellem/[email protected]
env:
ado_token: "${{ secrets.ADO_AOCTO_BOT_TOKEN }}"
github_token: "${{ secrets.GH_RAD_CI_BOT_PAT }}"
ado_organization: "azure-octo"
ado_project: "Incubations"
ado_area_path: "Incubations\\Radius"
ado_iteration_path: "Incubations\\Radius"
ado_new_state: "New"
ado_active_state: "Active"
ado_close_state: "Closed"
ado_wit: "GitHub Issue"