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 11#! /bin/bash
22
3+ set -x
4+
35USER=$1
4- TOKEN=$2
56
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 "
713
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
1016else
11- echo " false"
17+ IS_MEMBER= false
1218fi
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 1111jobs :
1212 update :
1313 runs-on : ubuntu-latest
14+ env :
15+ GH_TOKEN : ${{ secrets.UNITY_IMMUTABLE_SDK_GITHUB_TOKEN }}
1416 steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v3
19+
1520 - name : Check team membership
1621 id : check_team
1722 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"
1927 if [[ "$IS_MEMBER" != "true" ]]; then
2028 echo "Not a member of the SDK team, skipping update"
2129 exit 1
2230 fi
2331
24- - name : Checkout code
25- uses : actions/checkout@v3
26-
2732 - name : Set up Python
2833 uses : actions/setup-python@v4
2934 with :
5459 body : " Update version in package.json"
5560 branch : " release/update-version"
5661 commit-message : " release: update version"
57- labels : release
62+ labels : release
You can’t perform that action at this time.
0 commit comments