Skip to content

Commit 5f7de1f

Browse files
committed
fix: handle staging branch fetch in integrate-develop workflow
1 parent c277ee4 commit 5f7de1f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/integrate-develop.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,17 @@ jobs:
4646
- name: Get commit information
4747
id: commit-info
4848
run: |
49+
# Fetch staging branch
50+
git fetch origin staging:staging || echo "Staging branch not found"
51+
4952
# Get the latest commits from develop that aren't in staging
50-
COMMITS=$(git log --pretty=format:"- %s (%h)" origin/staging..HEAD | head -20)
51-
COMMIT_COUNT=$(git rev-list --count origin/staging..HEAD)
53+
if git rev-parse --verify origin/staging >/dev/null 2>&1; then
54+
COMMITS=$(git log --pretty=format:"- %s (%h)" origin/staging..HEAD | head -20)
55+
COMMIT_COUNT=$(git rev-list --count origin/staging..HEAD)
56+
else
57+
COMMITS=$(git log --pretty=format:"- %s (%h)" HEAD | head -20)
58+
COMMIT_COUNT=$(git rev-list --count HEAD)
59+
fi
5260
5361
# Escape for GitHub Actions output
5462
COMMITS="${COMMITS//'%'/'%25'}"

0 commit comments

Comments
 (0)