diff --git a/.github/actions/test-membership/action.yml b/.github/actions/test-membership/action.yml deleted file mode 100644 index fa3f03244..000000000 --- a/.github/actions/test-membership/action.yml +++ /dev/null @@ -1,32 +0,0 @@ -# -# Action: Test Membership -# -# Tests whether a member name is part of an organization. -# -# copied and adapted from https://github.com/hazelcast/hazelcast-tpm/blob/main/membership/action.yaml -# - -name: Test Membership -inputs: - organization-name: - required: true - member-name: - required: true - token: - required: true -outputs: - is-member: - description: "Whether the member name is a member of the organization" - value: ${{ steps.test-membership.outputs.is-member }} -runs: - using: "composite" - steps: - - id: test-membership - shell: bash - run: | - 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 }}") - if [[ "$response" -ne 200 ]] ; then - echo "is-member=false" >> $GITHUB_OUTPUT - else - echo "is-member=true" >> $GITHUB_OUTPUT - fi \ No newline at end of file diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 7c01a4c0c..c806d0796 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -39,21 +39,12 @@ jobs: name: Test Hazelcast Membership runs-on: ubuntu-latest outputs: - is-hazelcast: ${{ steps.test-membership.outputs.is-member }} + is-hazelcast: ${{ steps.test-membership.outputs.check-result }} steps: - # checkout the hazelcast/hazelcast-cpp-client repository - # bare minimum - just to use actions - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - token: ${{ secrets.GH_TOKEN }} - submodules: false - - name: Test id: test-membership - uses: ./.github/actions/test-membership + uses: hazelcast/hazelcast-tpm/membership@main with: organization-name: hazelcast member-name: ${{ github.actor }}