Skip to content
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/builder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Builder

on:
pull_request:

jobs:
check_for_membership:
runs-on: ubuntu-latest
name: Check membership of given user
outputs:
check-result: ${{ steps.composite.outputs.check-result }}

steps:
- name: Action for membership check
id: composite
uses: hazelcast/hazelcast-tpm/membership@main
with:
organization-name: 'hazelcast'
member-name: ${{ github.event.pull_request.head.repo.owner.login }}
token: ${{ secrets.GITHUB_TOKEN }}
default:
needs: [check_for_membership]
if: needs.check_for_membership.outputs.check-result == 'true'
runs-on: ubuntu-latest
steps:
- name: Detect untrusted community PR
if: ${{ needs.check_for_membership.outputs.check-result == 'false' }}
run: |
gh pr comment ${{ github.event.number }} \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not actually sure we want a comment here, an annotation the job is probably enough.

(I know you copied it from the PR builder, which does that - but I deliberately used comments there for backwards compatibility reasons)

Not sold either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed, I copied as made sense to me

an annotation the job is probably enough

What do you mean? Like remove commenting and echo the error?

Copy link
Contributor

@JackPGreen JackPGreen Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an annotation the job is probably enough
What do you mean? Like remove commenting and echo the error?

Just echoing the error in a format like this hazelcast/hazelcast-docker#821

--body "👽 Untrusted non Hazelcast PR, \`${GITHUB_JOB}\` must be [run manually](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})."
exit 1
env:
GH_TOKEN: ${{ inputs.GITHUB_TOKEN }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Build and test
env:
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}
run: |
set -x
mvn \
--batch-mode \
--errors \
--no-transfer-progress \
${RUNNER_DEBUG:+--show-version} \
package
env:
HZ_LICENSEKEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}