Skip to content

Commit e142aa9

Browse files
committed
feat: get teams
1 parent 7c10eb3 commit e142aa9

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: Add team label test
2+
3+
on: push
4+
5+
jobs:
6+
add-team-label:
7+
uses: ./.github/workflows/add-team-label.yml

.github/workflows/add-team-label.yml

+24-12
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,33 @@ name: Add team label
22

33
on:
44
workflow_call:
5-
secrets:
6-
PERSONAL_ACCESS_TOKEN:
7-
required: true
85

96
jobs:
107
add-team-label:
118
runs-on: ubuntu-latest
129
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v4
15-
16-
- name: Setup environment
17-
uses: metamask/github-tools/.github/actions/setup-environment@main
18-
19-
- name: Add team label
10+
- name: Get teams
11+
id: teams
12+
uses: octokit/[email protected]
2013
env:
21-
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
22-
run: yarn run add-team-label
14+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
with:
16+
query: |
17+
query teams($organization:String!,$user:String!) {
18+
organization(login: $organization) {
19+
teams(first: 100, userLogins: [$user]) {
20+
edges {
21+
node {
22+
name
23+
description
24+
slug
25+
}
26+
}
27+
}
28+
}
29+
}
30+
variables: |
31+
organization: ${{ github.event.repository.owner.name }}
32+
user: ${{ github.event.pull_request.user.login }}
33+
34+
- run: "echo '${{ steps.teams.outputs.data }}'"

0 commit comments

Comments
 (0)