Repository navigation
52 lines (48 loc) · 1.6 KB
/
Copy pathcontribution-gate.yml
File metadata and controls
52 lines (48 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Contribution Gate
on:
schedule:
- cron: "7,22,37,52 * * * *"
# Manual sweep over every open PR, e.g. after bulk-applying the
# `open-for-contribution` label. Set `dry_run` to log decisions without
# commenting or closing.
workflow_dispatch:
inputs:
dry_run:
description: "Evaluate and log decisions only; do not comment or close"
type: boolean
default: false
permissions: {}
concurrency:
# Serialize sweeps to avoid concurrent comments and closes.
group: contribution-gate
cancel-in-progress: false
queue: max
jobs:
gate-all:
name: Contribution Gate (all open PRs)
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
pull-requests: write
issues: read
contents: read
if: >
github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' &&
github.ref == format('refs/heads/{0}',
github.event.repository.default_branch))
steps:
# Only default-branch code runs with the write token, never PR code.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: ".bun-version"
no-cache: true
- name: Evaluate contribution gate across all open PRs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
DRY_RUN: ${{ inputs.dry_run || 'false' }}
run: bun .github/scripts/contribution-gate.ts