forked from longhorn/longhorn
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (63 loc) · 2.24 KB
/
add-to-projects.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
name: Add-To-Projects
on:
issues:
types: [opened]
jobs:
community:
runs-on: ubuntu-latest
steps:
- name: Is Longhorn Member
id: is-longhorn-member
continue-on-error: true
uses: tspascoal/get-user-teams-membership@v3
with:
username: ${{ github.event.issue.user.login }}
organization: longhorn
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Get Issue
if: steps.is-longhorn-member.outcome == 'success'
uses: octokit/[email protected]
id: issue
with:
route: GET /repos/${{ github.repository }}/issues/${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Add Issue to Community Sprint Project
id: add-project
if: |
steps.is-longhorn-member.outcome == 'success' &&
fromJSON(steps.is-longhorn-member.outputs.teams)[0] == null
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/longhorn/projects/5
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Update Item To New
if: |
steps.is-longhorn-member.outcome == 'success' &&
fromJSON(steps.is-longhorn-member.outputs.teams)[0] == null &&
steps.add-project.outputs.itemId != ''
uses: titoportas/[email protected]
with:
project-url: https://github.com/orgs/longhorn/projects/5
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
item-id: ${{ steps.add-project.outputs.itemId }}
field-keys: Status,Sprint
field-values: "New,[0]"
qa:
runs-on: ubuntu-latest
steps:
- name: Is Longhorn Member
id: is-longhorn-member
uses: tspascoal/get-user-teams-membership@v3
with:
username: ${{ github.event.issue.user.login }}
organization: longhorn
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Add Issue to QA Sprint Project
if: fromJSON(steps.is-longhorn-member.outputs.teams)[0] != null
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/longhorn/projects/4
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
labeled: kind/test, area/infra
label-operator: OR