mirror of
https://github.com/UniXNU/UniXNU.git
synced 2026-11-07 18:16:04 +03:00
fix(ci): validate the porting record after force pushes
Fall back to the default branch when the event baseline is absent from the checkout. Preserve available comparison commits and always run the validator. Validation: the actual workflow shell passes valid, empty, new-branch and unavailable force-push baseline cases.
This commit is contained in:
@@ -28,7 +28,8 @@ jobs:
|
||||
BASE: ${{ github.event.pull_request.base.sha || github.event.before }}
|
||||
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
||||
run: |
|
||||
if [[ -z "$BASE" || "$BASE" =~ ^0+$ ]]; then
|
||||
if [[ -z "$BASE" || "$BASE" =~ ^0+$ ]] ||
|
||||
! git -C device cat-file -e "${BASE}^{commit}" 2>/dev/null; then
|
||||
BASE="refs/remotes/origin/$DEFAULT_BRANCH"
|
||||
fi
|
||||
python3 tools/scripts/porting-record.py check --device device --base "$BASE"
|
||||
|
||||
Reference in New Issue
Block a user