Skip to content

Commit

Permalink
This branch was auto-updated!
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 29, 2023
2 parents 5137580 + 6a3e4c3 commit 61f0103
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 61f0103

Please sign in to comment.