Skip to content

Commit

Permalink
Hardcode team members in auto assign workflow (Shopify#1943)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Apr 16, 2024
1 parent d9fbe95 commit d07d9c1
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,28 @@ jobs:
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const devExpResponse = await github.rest.teams.listMembersInOrg({
org: "shopify",
team_slug: "ruby-dev-exp",
});
const members = devExpResponse.data.map((member) => member.login);
const fullTeam = [
"andyw8",
"dirceu",
"paracycle",
"vinistock",
"aryan-soni",
"rafaelfranca",
"Morriar",
"st0012",
"egiurleo",
"KaanOzkan"
];
const issue = github.event.issue;
if (!members.includes(issue.user.login)) {
const dxResponse = await github.rest.teams.listMembersInOrg({
org: "shopify",
team_slug: "ruby-dx",
});
const reviewers = dxResponse.data.map((member) => member.login);
const assignee = reviewers[Math.floor(Math.random() * reviewers.length)];
if (!fullTeam.includes(issue.user.login)) {
const dxReviewers = [
"andyw8",
"vinistock",
"aryan-soni",
"st0012",
];
const assignee = dxReviewers[Math.floor(Math.random() * dxReviewers.length)];
await github.rest.issues.addAssignees({
owner: context.repo.owner,
Expand Down

0 comments on commit d07d9c1

Please sign in to comment.