name: PR Open Limit on: pull_request_target: types: - opened - reopened - ready_for_review concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true permissions: contents: read pull-requests: write issues: write jobs: check-open-limit: name: Check Open Pull Request Limit runs-on: ubuntu-latest timeout-minutes: 10 # Advisory: a script failure must not put a red cross on the pull request. continue-on-error: true if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Install dependencies working-directory: .github/scripts run: npm ci - name: Check open pull request limit working-directory: .github/scripts run: node pr-open-limit.js env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.pull_request.number }} PR_AUTHOR: ${{ github.event.pull_request.user.login }} PR_IS_DRAFT: ${{ github.event.pull_request.draft }} MAX_OPEN_PRS: ${{ vars.MAX_OPEN_PRS_PER_AUTHOR || 5 }}