Skip to content

Commit

Permalink
- update once more
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbahl committed Sep 10, 2024
1 parent a56eaf3 commit 1979e8f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,17 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const { Octokit } = require("@octokit/rest");
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
});
const org = 'wpengine'; // replace with your GitHub org
const org = 'wpengine';
const username = context.payload.pull_request.user.login;
try {
const { data: membership } = await octokit.orgs.getMembershipForUser({
const { data: membership } = await github.rest.orgs.getMembershipForUser({
org,
username,
});
return { isMember: membership.state === 'active' };
} catch (error) {
return { isMember: false }; // If not a member or error occurs, treat as not a member
return { isMember: false }; // Treat as not a member if any error occurs
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 1979e8f

Please sign in to comment.