Skip to content

refine workflow

refine workflow #50

name: Staging Gate test
on:
pull_request:
paths:
- 'staging/**'
- 'tools/**'
jobs:
gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fail if staging folder is missing or empty
run: |
if [ ! -d staging ] || [ -z "$(ls -A staging)" ]; then
echo "::error ::staging folder is missing or empty. Please add or update at least one module."
exit 1
fi
- name: Staging compatibility check
run: bash tools/02_validate_module.sh
- name: Run all tools and report pass/fail
run: |
status=0
for tool in tools/[0-9][0-9]_*.sh; do
# Skip 02_validate_module.sh (already run)
if [[ "$(basename "$tool")" == "02_validate_module.sh" ]]; then
continue
fi
echo "=== Running: $tool ==="
bash "$tool"
result=$?
if [[ $result -eq 0 ]]; then
echo "::notice ::PASS: $tool"
else
echo "::error ::FAIL: $tool (exit code $result)"
status=1
fi
echo
done
exit $status