Public dry run dryrun-750f29790fe2
Source commit: 750f29790fe2046599fbe5b5d06fdb63d92fabff Public tree identity: sha256:02326e08850bb287585789733ea5f3f153e1f7f3fd88afcc24e249107df91506
This commit is contained in:
commit
de66658961
102 changed files with 31669 additions and 0 deletions
71
scripts/release-source-scan.sh
Executable file
71
scripts/release-source-scan.sh
Executable file
|
|
@ -0,0 +1,71 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$repo"
|
||||
|
||||
release_paths=(
|
||||
Cargo.toml
|
||||
Cargo.lock
|
||||
README.md
|
||||
crates
|
||||
examples
|
||||
private
|
||||
scripts
|
||||
vscode-extension
|
||||
)
|
||||
|
||||
existing_release_paths=()
|
||||
for path in "${release_paths[@]}"; do
|
||||
if [[ -e "$path" ]]; then
|
||||
existing_release_paths+=("$path")
|
||||
fi
|
||||
done
|
||||
|
||||
prose_scan_paths=(
|
||||
README.md
|
||||
crates
|
||||
examples
|
||||
private
|
||||
scripts
|
||||
vscode-extension
|
||||
)
|
||||
|
||||
existing_prose_scan_paths=()
|
||||
for path in "${prose_scan_paths[@]}"; do
|
||||
if [[ -e "$path" ]]; then
|
||||
existing_prose_scan_paths+=("$path")
|
||||
fi
|
||||
done
|
||||
|
||||
scan_globs=(
|
||||
--glob '!**/target/**'
|
||||
--glob '!**/node_modules/**'
|
||||
--glob '!scripts/release-source-scan.sh'
|
||||
)
|
||||
|
||||
placeholder_pattern='debugger-gate|experiments/debugger-gate|DISASMER-DEMO|device-code-placeholder|artifact://demo|vp-local-demo'
|
||||
if rg -n "${scan_globs[@]}" "$placeholder_pattern" "${existing_release_paths[@]}"; then
|
||||
echo "release source scan failed: stale experiment/demo placeholder reference found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
demo_setup_pattern='undocumented manual state|hidden setup|demo-only credentials?|hard-coded local paths?'
|
||||
if rg -n "${scan_globs[@]}" "$demo_setup_pattern" "${existing_prose_scan_paths[@]}"; then
|
||||
echo "release source scan failed: demo requires hidden setup or demo-only state" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hidden_local_pattern='file://|/home/[[:alnum:]_.-]+/|/Users/[[:alnum:]_.-]+/|C:\\Users\\|https?://(localhost|127\.0\.0\.1)[^[:space:]]*/artifacts/'
|
||||
if rg -n "${scan_globs[@]}" "$hidden_local_pattern" "${existing_release_paths[@]}"; then
|
||||
echo "release source scan failed: hidden local path or local artifact URL found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
public_wording_pattern='reddit|hacker news|lobsters|launch forum|traffic source|free tier'
|
||||
if rg -n "${scan_globs[@]}" "$public_wording_pattern" "${existing_prose_scan_paths[@]}"; then
|
||||
echo "release source scan failed: public-facing launch-forum/free-tier wording found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Release source scan passed"
|
||||
Loading…
Add table
Add a link
Reference in a new issue