File tree Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ set -x
4
+
3
5
USER=$1
4
- TOKEN=$2
5
6
6
- response=$( curl -s -H " Authorization: token $TOKEN " " https://api.github.com/orgs/immutable/teams/sdk/memberships/$USER " )
7
+ response=$( gh api \
8
+ -H " Accept: application/vnd.github+json" \
9
+ -H " X-GitHub-Api-Version: 2022-11-28" \
10
+ " /orgs/immutable/teams/sdk/memberships/${USER} " )
11
+
12
+ echo " $response "
7
13
8
- if echo " $response " | grep -q ' "state": "active"' ; then
9
- echo " true"
14
+ if echo " $response " | grep -q ' "state":"active"' ; then
15
+ IS_MEMBER= true
10
16
else
11
- echo " false"
17
+ IS_MEMBER= false
12
18
fi
19
+ echo " $IS_MEMBER "
20
+
21
+ # Set the environment variable for the GitHub workflow
22
+ echo " IS_MEMBER=$IS_MEMBER " >> " $GITHUB_ENV "
Original file line number Diff line number Diff line change 11
11
jobs :
12
12
update :
13
13
runs-on : ubuntu-latest
14
+ env :
15
+ GH_TOKEN : ${{ secrets.UNITY_IMMUTABLE_SDK_GITHUB_TOKEN }}
14
16
steps :
17
+ - name : Checkout code
18
+ uses : actions/checkout@v3
19
+
15
20
- name : Check team membership
16
21
id : check_team
17
22
run : |
18
- IS_MEMBER=$(./.github/scripts/check_team_membership.sh "${{ github.actor }}" "${{ secrets.GITHUB_TOKEN }}")
23
+ ./.github/scripts/check_team_membership.sh "${{ github.actor }}" "${{ secrets.UNITY_IMMUTABLE_SDK_GITHUB_TOKEN }}"
24
+ # shellcheck disable=SC1090
25
+ source "$GITHUB_ENV"
26
+ echo "${{ github.actor }} is a member of the SDK team: $IS_MEMBER"
19
27
if [[ "$IS_MEMBER" != "true" ]]; then
20
28
echo "Not a member of the SDK team, skipping update"
21
29
exit 1
22
30
fi
23
31
24
- - name : Checkout code
25
- uses : actions/checkout@v3
26
-
27
32
- name : Set up Python
28
33
uses : actions/setup-python@v4
29
34
with :
54
59
body : " Update version in package.json"
55
60
branch : " release/update-version"
56
61
commit-message : " release: update version"
57
- labels : release
62
+ labels : release
You can’t perform that action at this time.
0 commit comments