Skip to content

Commit

Permalink
Merge branch 'current' into postgres-privatelink
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Sep 29, 2023
2 parents 81b8b1b + 6a3e4c3 commit 344c8ea
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,32 @@ jobs:
- uses: actions/github-script@v6
with:
script: |
const creator = context.payload.sender.login
const creator = context.payload.sender.login;
const opts = github.rest.issues.listForRepo.endpoint.merge({
...context.issue,
creator,
state: 'all'
})
const issues = await github.paginate(opts)
state: 'all',
});
const issues = await github.paginate(opts);
let isAlreadyContributor = false;
for (const issue of issues) {
if (issue.number === context.issue.number) {
continue
continue;
}
if (issue.pull_request) {
return // creator is already a contributor
if (issue.pull_request && issue.user.login === creator) {
isAlreadyContributor = true;
break;
}
}
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['new contributor']
})
if (!isAlreadyContributor) {
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['new contributor'],
});
}

0 comments on commit 344c8ea

Please sign in to comment.