-
Notifications
You must be signed in to change notification settings - Fork 283
51 lines (46 loc) · 2.29 KB
/
Copy pathcontribution-rules.yml
File metadata and controls
51 lines (46 loc) · 2.29 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
name: Contribution rules triage
# Applies workflow labels to incoming issues/PRs. All configurable values —
# labels, patterns, disclosure token, message texts — live in
# .github/scripts/triage-config.mjs. Rule + label logic lives in
# .github/scripts/triage.mjs. This file only wires them together.
#
# Companion workflow auto-close-unaddressed.yml then posts a warning and
# eventually closes anything labeled `state-needs-updates`.
on:
issues:
types: [opened, edited, reopened]
pull_request_target:
# `synchronize` is intentionally excluded — new commits don't change the
# PR description, and re-running triage on every push would just re-apply
# the same label and re-post/no-op the same comment for no benefit.
types: [opened, edited, reopened]
permissions:
issues: write
pull-requests: write
jobs:
triage:
# ─────────────────────────────────────────────────────────────────
# Skip maintainers and bot-authored submissions:
# • OWNER / COLLABORATOR / MEMBER → maintainers, trusted; hardcoded
# so a maintainer submission doesn't even start a job.
# • user.type == 'Bot' → Dependabot, Renovate, and similar. They
# don't fill in contributor templates and shouldn't be nudged.
# ─────────────────────────────────────────────────────────────────
if: >-
github.event.issue.user.type != 'Bot'
&& github.event.pull_request.user.type != 'Bot'
&& !contains(fromJSON('["OWNER","COLLABORATOR","MEMBER"]'),
github.event.issue.author_association
|| github.event.pull_request.author_association)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
sparse-checkout: .github/scripts
sparse-checkout-cone-mode: false
- name: Apply labels
uses: actions/github-script@v9
with:
script: |
const { default: triage } = await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/triage.mjs`);
await triage({ github, context, core });