Skip to content

Commit

Permalink
rest - update
Browse files Browse the repository at this point in the history
  • Loading branch information
ANSHIKA-26 committed Oct 2, 2024
1 parent 02955fd commit d810064
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v3

- name: Fetch contributor's issues
uses: actions/github-script@v6.1.0 # Updated to a newer version
uses: actions/github-script@v7 # Updated to use the latest version (v7)
with:
script: |
const user = context.payload.issue.user.login;
Expand All @@ -30,17 +30,19 @@ jobs:
const issueLimit = 3;
if (issueCount >= issueLimit) {
// Close the new issue and comment
// Close the new issue
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
state: 'closed'
});
// Leave a comment explaining why it was closed
// Comment on the issue explaining why it was closed
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
body: `Hello, since this is an open-source project, we would like every contributor to have a chance to contribute
body: `Hello, since this is an open-source project, we would like every contributor to have a chance to contribute. Therefore, we have restricted the number of issues one contributor can create at a time. In order to make a new issue, kindly close one of your open issues first, so that there is less spamming of issues and more PR merges!`
});
}

0 comments on commit d810064

Please sign in to comment.