Skip to content

Commit 0391041

Browse files
authored
pr builder for github actions [API-1865] (#1173)
* pr builder for github actions * Update build-pr.yml review fixes
1 parent 9d700f3 commit 0391041

File tree

2 files changed

+563
-0
lines changed

2 files changed

+563
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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

0 commit comments

Comments
 (0)