Skip to content

ci/request-review: init #5

ci/request-review: init

ci/request-review: init #5

Workflow file for this run

name: Request Review
on:
pull_request:
types: [labeled]
jobs:
assign-reviewers:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v8
with:
script: |
const mapping = {
"felbinger": ["FRR", "VyOS", "BIRD", "Mikrotik"],
"peterablehmann": ["FRR", "VyOS", "BIRD", "JunOS"],
"Vincentz-VP": ["Arista"],
"GIC-de": ["RtBrick RBFS", "JunOS"],
"dinoex": ["BIRD", "Nokia SR OS"],
};
// transform mapping matrix, to platform to member mapping
const mappingT = Object.entries(mapping).reduce((acc, [name, platforms]) => {
platforms.forEach(platform => (acc[platform] = [...(acc[platform] || []), name]));
return acc;
}, {});
// get all labels from pull request
const labels = context.payload.pull_request.labels.map(l => l.name.replace(/0\.platform:/, "");
for (const label of labels) {
console.log(`PR contains ${label}, reviewers:`, mappingT[label])
// TODO request review
}
console.log(context);