Skip to content

Commit 01e5ef0

Browse files
Use variable for pool
1 parent 8c80c88 commit 01e5ef0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/auto-assign-pr.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,19 @@ jobs:
2525
steps:
2626
- name: Calculate Workload and Apply
2727
uses: actions/github-script@v7
28+
env:
29+
PR_REVIEWER_POOL: ${{ vars.PR_REVIEWER_POOL }}
2830
with:
2931
script: |
32+
// Read the candidate pool from the repository variable PR_REVIEWER_POOL
33+
// (Settings > Secrets and variables > Actions > Variables).
34+
// Value is a comma-separated list of GitHub logins who are qualified to be assigned PRs to review.
35+
const rawPool = process.env.PR_REVIEWER_POOL ?? '';
36+
const pool = rawPool.split(',').map(s => s.trim()).filter(Boolean);
37+
if (pool.length === 0) {
38+
core.warning('PR_REVIEWER_POOL variable is empty or not set. Skipping auto-assignment.');
39+
return;
40+
}
3041
const owner = context.repo.owner;
3142
const repo = context.repo.repo;
3243
const prNumber = context.issue.number;

0 commit comments

Comments
 (0)