Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
uses: ./.github/workflows/frontend-build.yml
with:
node_version: '24.x'
pull_number: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}

apphost-build:
needs: changes
Expand Down
27 changes: 26 additions & 1 deletion .github/workflows/frontend-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
required: true
default: "24.x"
type: string
pull_number:
description: Pull request number when available
required: false
default: ""
type: string

permissions:
contents: read
Expand All @@ -25,7 +30,27 @@ jobs:
fetch-depth: 0

- name: Ensure full git history for Lunaria
run: git fetch --unshallow 2>/dev/null || true
env:
PULL_NUMBER: ${{ inputs.pull_number }}
run: |
if [ -n "$PULL_NUMBER" ]; then
case "$PULL_NUMBER" in
(*[!0-9]*)
echo "Invalid pull_number input: '$PULL_NUMBER'" >&2
exit 1
;;
esac

pull_ref="+refs/pull/${PULL_NUMBER}/head:refs/remotes/origin/pull/${PULL_NUMBER}/head"

if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
git fetch origin "$pull_ref" --unshallow
else
git fetch origin "$pull_ref"
fi
elif [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
git fetch --unshallow
fi

- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
with:
Expand Down
Loading