Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
69 lines (69 loc) · 2.11 KB
/
Copy pathaction.yml
File metadata and controls
69 lines (69 loc) · 2.11 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
57
58
59
60
61
62
63
64
65
66
67
68
69
name: DeployProof
description: Prove a preview deployment behaves like production
author: Loke
branding:
icon: check-circle
color: purple
inputs:
preview:
description: Preview deployment base URL
required: true
production:
description: Production base URL
required: true
config:
description: Path to a DeployProof config file
required: false
default: ""
routes:
description: Newline-separated routes to compare in addition to the config file
required: false
default: ""
timeout:
description: Optional per-request timeout in milliseconds
required: false
default: ""
strict:
description: Boolean string; true fails when warnings are found
required: false
default: "true"
runs:
using: composite
steps:
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24
package-manager-cache: false
- name: Compare preview with production
shell: bash
env:
DEPLOYPROOF_PREVIEW: ${{ inputs.preview }}
DEPLOYPROOF_PRODUCTION: ${{ inputs.production }}
DEPLOYPROOF_CONFIG: ${{ inputs.config }}
DEPLOYPROOF_ROUTES: ${{ inputs.routes }}
DEPLOYPROOF_TIMEOUT: ${{ inputs.timeout }}
DEPLOYPROOF_STRICT: ${{ inputs.strict }}
run: |
set -euo pipefail
args=("--format" "github")
if [[ -n "$DEPLOYPROOF_CONFIG" ]]; then
args+=("--config" "$DEPLOYPROOF_CONFIG")
fi
while IFS= read -r route || [[ -n "$route" ]]; do
if [[ -n "$route" ]]; then
args+=("--route" "$route")
fi
done <<< "$DEPLOYPROOF_ROUTES"
if [[ -n "$DEPLOYPROOF_TIMEOUT" ]]; then
args+=("--timeout" "$DEPLOYPROOF_TIMEOUT")
fi
case "$DEPLOYPROOF_STRICT" in
true) args+=("--strict") ;;
false) args+=("--no-strict") ;;
*)
printf '%s\n' "::error title=Invalid DeployProof input::strict must be true or false"
exit 2
;;
esac
node "$GITHUB_ACTION_PATH/dist/cli.js" "${args[@]}"