Repository navigation
53 lines (45 loc) · 1.73 KB
/
Copy pathparam-guard.yml
File metadata and controls
53 lines (45 loc) · 1.73 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
53
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:
# Also run on PRs stacked onto a feature branch, not just those targeting
# main, so every PR in a stack is verified before its base lands.
branches:
- main
- "feat/**"
- "fix/**"
- "chore/**"
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."