forked from conan-io/conan-center-index
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 'Limit PRs open per user' | ||
description: 'Get all changed files in a Pull Request' | ||
author: 'danimtb' | ||
inputs: | ||
files: | ||
description: "Limit the number of open pull-request that user can have open at the same time" | ||
required: false | ||
default: "" | ||
limit: | ||
description: "Maximum number of PRs an author can open" | ||
required: true | ||
default: "10" | ||
comment: | ||
description: "Comment to post in the github PR when the limit of open PRs is reached" | ||
required: true | ||
default: "This is a comment" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const creator = context.payload.sender.login | ||
const opts = github.rest.issues.listForRepo.endpoint.merge({ | ||
...context.issue, | ||
creator, | ||
is: 'pr' | ||
state: 'open', | ||
sort: 'created', | ||
order: 'asc' | ||
}) | ||
const prs = await github.paginate(opts) | ||
await github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: Your number of PRs open is ${{ prs.length }} :wink:` | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: "[service] Alert Community" | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened] | ||
|
||
env: | ||
PYVER: "3.10" | ||
|
||
jobs: | ||
comment: | ||
# if: github.repository == 'conan-io/conan-center-index' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ./.github/actions/prs_user_limit | ||
with: | ||
limit: 27 | ||
comment: "my comment" |