File tree Expand file tree Collapse file tree 2 files changed +563
-0
lines changed Expand file tree Collapse file tree 2 files changed +563
-0
lines changed Original file line number Diff line number Diff line change
1
+ #
2
+ # Action: Test Membership
3
+ #
4
+ # Tests whether a member name is part of an organization.
5
+ #
6
+ # copied and adapted from https://github.com/hazelcast/hazelcast-tpm/blob/main/membership/action.yaml
7
+ #
8
+
9
+ name : Test Membership
10
+ inputs :
11
+ organization-name :
12
+ required : true
13
+ member-name :
14
+ required : true
15
+ token :
16
+ required : true
17
+ outputs :
18
+ is-member :
19
+ description : " Whether the member name is a member of the organization"
20
+ value : ${{ steps.test-membership.outputs.is-member }}
21
+ runs :
22
+ using : " composite"
23
+ steps :
24
+ - id : test-membership
25
+ shell : bash
26
+ run : |
27
+ response=$(curl -v -H "Authorization: token ${{ inputs.token }}" --write-out '%{http_code}' --silent --output /dev/null "https://api.github.com/orgs/${{ inputs.organization-name }}/memberships/${{ inputs.member-name }}")
28
+ if [[ "$response" -ne 200 ]] ; then
29
+ echo "is-member=false" >> $GITHUB_OUTPUT
30
+ else
31
+ echo "is-member=true" >> $GITHUB_OUTPUT
32
+ fi
You can’t perform that action at this time.
0 commit comments