use excluded-assignees
This commit is contained in:
parent
3acbc68df8
commit
17e5eb912f
2 changed files with 42 additions and 1 deletions
16
.github/workflows/stale-issue-helper.yaml
vendored
16
.github/workflows/stale-issue-helper.yaml
vendored
|
|
@ -13,6 +13,20 @@ jobs:
|
|||
matrix:
|
||||
assignee: [sestinj, Patrick-Erichsen, tomasz-stefaniak, RomneyDa]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
|
||||
- name: Compute excluded assignees
|
||||
id: excluded-assignees
|
||||
run: |
|
||||
node ./scripts/getExcludedAssignees.js sestinj,Patrick-Erichsen,tomasz-stefaniak,RomneyDa ${{ matrix.assignee }}
|
||||
|
||||
echo "excluded_assignees=$result" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
stale-issue-message: "This issue hasn't been updated in a while. @${{ matrix.assignee }} can you take a look?"
|
||||
|
|
@ -25,4 +39,4 @@ jobs:
|
|||
debug-only: true
|
||||
exempt-issue-labels: "needs-triage,no-stale"
|
||||
exempt-pr-labels: "no-stale,no-stale"
|
||||
exempt-assignees: ${{ toJSON(fromJSON('["sestinj", "Patrick-Erichsen", "tomasz-stefaniak", "RomneyDa"]').filter(user => user != matrix.assignee)) }}
|
||||
exempt-assignees: ${{ steps.excluded-assignees.outputs.excluded_assignees }}
|
||||
|
|
|
|||
27
scripts/getExcludedAssignees.js
Normal file
27
scripts/getExcludedAssignees.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
function removeStringFromList(list, stringToRemove) {
|
||||
return list.filter((item) => item !== stringToRemove);
|
||||
}
|
||||
|
||||
function main() {
|
||||
// Get command line arguments
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
if (args.length < 2) {
|
||||
console.error(
|
||||
"Usage: node script.js <comma-separated-list> <string-to-remove>",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const list = args[0].split(",");
|
||||
const stringToRemove = args[1];
|
||||
|
||||
const result = removeStringFromList(list, stringToRemove);
|
||||
|
||||
// Output the result as comma-separated values
|
||||
console.log(result.join(","));
|
||||
}
|
||||
|
||||
main();
|
||||
Loading…
Add table
Reference in a new issue