diff options
author | nkozlovskiy <nmk@ydb.tech> | 2023-12-05 00:36:01 +0300 |
---|---|---|
committer | nkozlovskiy <nmk@ydb.tech> | 2023-12-05 08:14:49 +0300 |
commit | e3af9d79b9c29714dda6df3a21f2be4e006eb4e4 (patch) | |
tree | f066fb98a08834ac109210ced2ebb7cce2f54c0a | |
parent | 4288daba4990d7137ae55f2767eecc98c38ee7a6 (diff) | |
download | ydb-e3af9d79b9c29714dda6df3a21f2be4e006eb4e4.tar.gz |
ci: replace org check membership in favour of repo check collaborator
-rw-r--r-- | .github/workflows/pr_check.yml | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index d496053d81..16043ed9ee 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -34,10 +34,11 @@ jobs: // How to interpret membership status code: // https://docs.github.com/en/rest/orgs/members?apiVersion=2022-11-28#check-organization-membership-for-a-user - const isOrgMember = async function () { + const isRepoCollaborator = async function () { try { - const response = await github.rest.orgs.checkMembershipForUser({ - org: context.payload.organization.login, + const response = await github.rest.repos.checkCollaborator({ + owner: context.payload.repository.owner.login, + repo: context.payload.repository.name, username: userLogin, }); return response.status == 204; @@ -50,10 +51,12 @@ jobs: } if (context.payload.repository.owner.login == userLogin) { + console.log("You are the repository owner!"); return true; } - if (await isOrgMember()) { + if (await isRepoCollaborator()) { + console.log("You are a collaborator!"); return true; } @@ -61,6 +64,9 @@ jobs: const okToTestLabel = labels.find( label => label.name == 'ok-to-test' ); + + console.log("okToTestLabel=%o", okToTestLabel !== undefined); + return okToTestLabel !== undefined; - name: comment-if-waiting-on-ok if: steps.check-ownership-membership.outputs.result == 'false' && |