fix(actions): syntax error in script

pull/52324/head
Mrugesh Mohapatra 2023-11-12 11:52:13 +05:30
parent 4ac6e8fb26
commit e9df4ff2c9
No known key found for this signature in database
1 changed files with 15 additions and 10 deletions

View File

@ -21,18 +21,23 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prAuthor = context.payload.pull_request.user.login;
const response = await github.rest.teams
.getMembershipForUserInOrg({
org: context.repo.owner,
team_slug: team,
username: prAuthor
})
.catch(() => {
status: 404;
});
let isAllowListed = false;
if (prAuthor === 'renovate[bot]' || response.status === 200) {
if (prAuthor === 'renovate[bot]') {
isAllowListed = true;
} else {
const teams = ['ops', 'bots', 'staff', 'dev-team', 'moderators'];
for (const team of teams) {
const response = await github.rest.teams.getMembershipForUserInOrg({
org: context.repo.owner,
team_slug: team,
username: prAuthor
});
}).catch(() => ({status: 404}));
if (response.status == 200) {
isAllowListed = true;
break;
}
}
}
core.setOutput('is_allow_listed', isAllowListed);