Skip to content
Merged
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
15 changes: 14 additions & 1 deletion scripts/setup_quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,20 @@ update_spm_dependency() {
*)
# For PR testing, point to the current commit.
local current_revision
current_revision=$(git -C "$root_dir" rev-parse HEAD)

# Detect if we are in a PR or a regular push
if [ "${GITHUB_EVENT_NAME:-}" == "pull_request" ]; then
if ! command -v jq &> /dev/null; then
echo "Error: jq is required for PR testing." >&2
exit 1
fi
# In a PR, read the real commit SHA from the event payload
# This guarantees a hash that exists on the remote server
current_revision=$(jq -r .pull_request.head.sha "${GITHUB_EVENT_PATH}")
else
# In a Push (or local run), HEAD is safe to use
current_revision=$(git -C "$root_dir" rev-parse HEAD)
fi
echo "Setting SPM dependency to current revision: ${current_revision}"
"$scripts_dir/update_firebase_spm_dependency.sh" \
"$absolute_project_file" --revision "$current_revision"
Expand Down
Loading