Skip to content

Commit a6b967b

Browse files
Merge pull request #63 from w3c/extract-hr-repos
Add a workflow to extract repositories with horizontal review labels
2 parents 02e9899 + 7110789 commit a6b967b

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/validate.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ jobs:
2121
run: node validate.js > report.json
2222
- name: Run extract-rec-track.js
2323
run: node extract-rec-track.js > rec-track-repos.json
24+
- name: Run extract-horizontal-reviews.js
25+
run: node extract-horizontal-reviews.js > hr-repos.json
2426
- name: Commit changes
2527
run: |
2628
git config user.name "w3c-validate-repos-bot"
2729
git config user.email "<>"
28-
git add report.json rec-track-repos.json
29-
git commit -m "Update report.json and rec-track-repos.json"
30+
git add report.json rec-track-repos.json hr-repos.json
31+
git commit -m "Update report.json, rec-track-repos.json, hr-repos.json"
3032
git show
3133
- name: Push changes
3234
if: github.ref == 'refs/heads/master'

extract-horizontal-reviews.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* eslint-env node */
2+
3+
"use strict";
4+
5+
const repos = require("./report.json").repos;
6+
7+
const hrLabelRegexp = new RegExp(/-(tracker|needs-resolution)$/);
8+
const isHRLabel = n => n.name.match(hrLabelRegexp);
9+
10+
console.log(JSON.stringify(
11+
repos.filter(r => r.labels && r.labels.find(isHRLabel))
12+
.map(r => r.owner.login + "/" + r.name),
13+
null,
14+
2)
15+
);

0 commit comments

Comments
 (0)