Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve identity checks in autoclose workflow #349

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/auto-close-community-issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class AutoCloseCommunityIssues {
},
});

const maintainerStatuses = `fromJSON('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]')`;
const comment =
`Hi there! 👋 We appreciate your interest, but this is probably not the right place.
All the code in this repository is auto-generated using
Expand All @@ -53,7 +54,7 @@ export class AutoCloseCommunityIssues {
permissions: {
issues: JobPermission.WRITE,
},
if: "github.event.issue.author_association != 'OWNER' && github.event.issue.author_association != 'MEMBER' && github.event.issue.author_association != 'COLLABORATOR'",
if: `github.event.issue.user.login == 'team-tf-cdk' || contains(${maintainerStatuses}, github.event.issue.author_association)`,
steps: [
{
name: "Checkout",
Expand Down Expand Up @@ -84,7 +85,7 @@ export class AutoCloseCommunityIssues {
permissions: {
pullRequests: JobPermission.WRITE,
},
if: "github.event.pull_request.author_association != 'OWNER' && github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'COLLABORATOR'",
if: `github.event.pull_request.user.login == 'team-tf-cdk' || contains(${maintainerStatuses}, github.event.pull_request.author_association)`,
steps: [
{
name: "Checkout",
Expand Down
Loading