-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (39 loc) · 1.53 KB
/
Copy pathparam-guard.yml
File metadata and controls
47 lines (39 loc) · 1.53 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
name: Param guard
# Blocks pull requests that remove a parameter from a model that still exists.
# Removing a parameter is breaking: every Manifest user who already configured it
# loses the ability to see or change that setting.
#
# Override: a maintainer applies the `allow-param-removal` label to the PR. The
# label change re-triggers this workflow (see `types` below) and the guard step
# is skipped, leaving an auditable warning in the checks output.
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, labeled, unlabeled]
jobs:
no-param-removals:
name: No parameter removals
runs-on: ubuntu-latest
steps:
- name: Check out PR
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch base branch
run: git fetch --no-tags origin "${{ github.base_ref }}"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Guard against parameter removals
if: ${{ !contains(github.event.pull_request.labels.*.name, 'allow-param-removal') }}
run: npm run guard:params
env:
BASE_REF: "origin/${{ github.base_ref }}"
- name: Removal override acknowledged
if: ${{ contains(github.event.pull_request.labels.*.name, 'allow-param-removal') }}
run: |
echo "::warning::'allow-param-removal' label present — parameter-removal guard intentionally skipped for this PR."