Skip to content

When github.actor is a member, not github.repo_owner #27160

Discussion options

You must be logged in to vote

The solution I came up with is this:

Write a script that would compare github.actor against each member’s login name in an organization, taken from a request like this https://api.github.com/orgs/github/members and store the outcome in an output of that step, so it can be used in the original condition like this:

if: github.repository_owner == github.actor || isTheActorAlsoMember // false || true

The script should look something like this:

let data = (https://api.github.com/orgs/github/members);
let isActorAlsoMember = false;
const githubActor = github.actor;

for (member in data) {
if (isActorAlsoMember) {
break;
}
else {
isActorAlsoMember = githubActor === member.login
}
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant