Support field_mask.proto for GRPC #137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Auto assign maintainer to issue" | |
on: | |
# makes this workflow re-usable | |
workflow_call: | |
issues: | |
types: [opened] | |
permissions: | |
issues: write | |
jobs: | |
assign-user: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
const assignees = ['mstoykov', 'codebien', 'olegbespalov', 'oleiade']; | |
const assigneeCount = 1; | |
// Do not automatically assign users if someone was already assigned or it was opened by a maintainer | |
if (context.payload.issue.assignees.length > 0 || assignees.includes(context.payload.issue.user.login)) { | |
return; | |
} | |
const crypto = require("node:crypto"); | |
const getNRandom = (n, array) => { | |
let result = new Array(); | |
for (;n > 0 && array.length > 0; n--) { | |
const chosen = array[crypto.randomInt(array.length)]; | |
result.push(chosen); | |
array = array.filter(el => el != chosen); | |
} | |
return result; | |
} | |
github.rest.issues.addAssignees({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
assignees: getNRandom(assigneeCount, assignees), | |
}); | |
github.rest.issues.addLabels({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
labels: ["triage"] | |
}); |