aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornkozlovskiy <nmk@ydb.tech>2023-12-05 00:36:01 +0300
committernkozlovskiy <nmk@ydb.tech>2023-12-05 08:14:49 +0300
commite3af9d79b9c29714dda6df3a21f2be4e006eb4e4 (patch)
treef066fb98a08834ac109210ced2ebb7cce2f54c0a
parent4288daba4990d7137ae55f2767eecc98c38ee7a6 (diff)
downloadydb-e3af9d79b9c29714dda6df3a21f2be4e006eb4e4.tar.gz
ci: replace org check membership in favour of repo check collaborator
-rw-r--r--.github/workflows/pr_check.yml14
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' &&