Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
56 lines (52 loc) · 2.33 KB
/
Copy pathaction.yml
File metadata and controls
56 lines (52 loc) · 2.33 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
54
55
56
name: "Classify changed files"
description: "Classifies a pull request change range as documentation-only or full validation. The classification fails safe: every uncertain input selects full validation."
inputs:
event-name:
description: "GitHub event name that drives skip eligibility"
required: true
head-sha:
description: "Head commit SHA of the classification range"
required: true
force-full-label:
description: "When true, force full validation because the ci:full-validation label is present"
required: false
default: "false"
force-full-variable:
description: "When true, force full validation because the ZOO_CODE_REQUIRE_FULL_VALIDATION repository variable is true"
required: false
default: "false"
outputs:
category:
description: "docs-only or full"
value: ${{ steps.classify.outputs.category }}
reason:
description: "Human-readable classification reason"
value: ${{ steps.classify.outputs.reason }}
reason-code:
description: "Stable classification reason code"
value: ${{ steps.classify.outputs.reason-code }}
changed-files:
description: "Number of changed files in the classification range"
value: ${{ steps.classify.outputs.changed-files }}
allowlist-fingerprint:
description: "Fingerprint of the active documentation-only allowlist"
value: ${{ steps.classify.outputs.allowlist-fingerprint }}
runs:
using: "composite"
steps:
- id: classify
shell: bash
run: |
HEAD_SHA="${{ inputs.head-sha }}"
FLAGS=()
if [[ "${{ inputs.force-full-label }}" == "true" ]]; then
FLAGS+=("--force-full-label")
fi
if [[ "${{ inputs.force-full-variable }}" == "true" ]]; then
FLAGS+=("--force-full-variable")
fi
# The pull_request checkout is the synthetic merge commit, so its
# first parent is the base branch tip that was actually merged
# into. A failed resolution fails the step and fails safe.
BASE_SHA="$(git rev-parse "${HEAD_SHA}^1")"
node scripts/change-classification.mjs ci --event "${{ inputs.event-name }}" --head "$HEAD_SHA" --base "$BASE_SHA" "${FLAGS[@]}"