Skip to content

Fix entrypoint pointing to an invalid index.js that does not exist causing issues with jest for example #10

Fix entrypoint pointing to an invalid index.js that does not exist causing issues with jest for example

Fix entrypoint pointing to an invalid index.js that does not exist causing issues with jest for example #10

name: Validate merge source OSS
on:
pull_request:
workflow_dispatch:
jobs:
check-source:
runs-on: ubuntu-latest
steps:
- name: Enforce allowed source branches
run: |
BASE="${{ github.base_ref }}" # target branch
HEAD="${{ github.head_ref }}" # source branch
echo "PR: $HEAD -> $BASE"
case "$BASE" in
main)
if [[ "$HEAD" =~ ^r/release\..* || "$HEAD" == "alpha" ]]; then
echo "OK: $HEAD is allowed into main"
else
echo "::error::PRs into main must come from r/release.* or alpha (got '$HEAD')"
exit 1
fi
;;
alpha|integration)
if [[ "$HEAD" =~ ^r/release\..* ]]; then
echo "OK: $HEAD is allowed into $BASE"
else
echo "::error::PRs into $BASE must come from r/release.* (got '$HEAD')"
exit 1
fi
;;
*)
echo "No source restriction configured for $BASE"
;;
esac