Update auto-closes workflow to check actor login

This commit is contained in:
amd64fox
2025-10-11 14:06:20 +03:00
committed by GitHub
parent 3c3d5cde71
commit 2051de8ba7
@@ -17,12 +17,13 @@ jobs:
script: | script: |
const issue = context.payload.issue; const issue = context.payload.issue;
const title = issue.title.toLowerCase(); const title = issue.title.toLowerCase();
const authorAssociation = issue.author_association; const actor = context.payload.sender.login;
const privilegedRoles = ['OWNER', 'MEMBER', 'COLLABORATOR']; // Проверяем, кто выполнил действие (не создателя issue, а того кто сейчас действует)
const privilegedUsers = ['amd64fox'];
if (privilegedRoles.includes(authorAssociation)) { if (privilegedUsers.includes(actor)) {
console.log('Issue #' + issue.number + ' action performed by ' + authorAssociation + ' - will not auto-close'); console.log('Issue #' + issue.number + ' action performed by @' + actor + ' - will not auto-close');
return; return;
} }