@@ -75,19 +75,23 @@ jobs:
7575 - name : Create PR to staging
7676 if : steps.check-pr.outputs.pr_exists == 'false'
7777 run : |
78+ COMMIT_COUNT="${{ steps.commit-info.outputs.commit_count }}"
79+ TIMESTAMP="${{ steps.commit-info.outputs.timestamp }}"
80+ COMMITS="${{ steps.commit-info.outputs.commits }}"
81+
7882 gh pr create \
7983 --base staging \
8084 --head develop \
8185 --title "🔄 Integrate develop → staging" \
8286 --body "## 🚀 Integration from develop to staging
8387
8488# ## 📊 Summary
85- - **Commits**: ${{ steps.commit-info.outputs.commit_count } } new commits
86- - **Created**: ${{ steps.commit-info.outputs.timestamp } }
89+ - **Commits**: ${COMMIT_COUNT } new commits
90+ - **Created**: ${TIMESTAMP }
8791- **Auto-generated**: This PR was automatically created by the integration workflow
8892
8993# ## 📝 Recent Commits
90- ${{ steps.commit-info.outputs.commits } }
94+ ${COMMITS }
9195
9296# ## 🔍 What happens next?
93971. Review the changes in this PR
@@ -109,19 +113,24 @@ ${{ steps.commit-info.outputs.commits }}
109113 - name : Update existing PR
110114 if : steps.check-pr.outputs.pr_exists == 'true'
111115 run : |
116+ PR_NUMBER="${{ steps.check-pr.outputs.pr_number }}"
117+ COMMIT_COUNT="${{ steps.commit-info.outputs.commit_count }}"
118+ TIMESTAMP="${{ steps.commit-info.outputs.timestamp }}"
119+ COMMITS="${{ steps.commit-info.outputs.commits }}"
120+
112121 # Update PR title with commit count
113- gh pr edit ${{ steps.check-pr.outputs.pr_number }} \
114- --title "🔄 Integrate develop → staging (${{ steps.commit-info.outputs.commit_count } } commits)"
122+ gh pr edit $PR_NUMBER \
123+ --title "🔄 Integrate develop → staging (${COMMIT_COUNT } commits)"
115124
116125 # Get current PR body
117- CURRENT_BODY=$(gh pr view ${{ steps.check-pr.outputs.pr_number }} --json body --jq '.body')
126+ CURRENT_BODY=$(gh pr view $PR_NUMBER --json body --jq '.body')
118127
119128 # Create updated section
120- UPDATED_SECTION="### 🔄 Last Updated: ${{ steps.commit-info.outputs.timestamp } }
121- **New commits**: ${{ steps.commit-info.outputs.commit_count } }
129+ UPDATED_SECTION="### 🔄 Last Updated: ${TIMESTAMP }
130+ **New commits**: ${COMMIT_COUNT }
122131
123132# ## 📝 Recent Commits
124- ${{ steps.commit-info.outputs.commits } }"
133+ ${COMMITS }"
125134
126135 # Update or append the updated section
127136 if echo "$CURRENT_BODY" | grep -q "### 🔄 Last Updated:"; then
@@ -140,16 +149,16 @@ $UPDATED_SECTION"
140149 fi
141150
142151 # Update PR body
143- gh pr edit ${{ steps.check-pr.outputs.pr_number }} --body "$NEW_BODY"
152+ gh pr edit $PR_NUMBER --body "$NEW_BODY"
144153
145154 # Add labels
146- gh pr edit ${{ steps.check-pr.outputs.pr_number }} \
155+ gh pr edit $PR_NUMBER \
147156 --add-label "auto-updated" \
148157 --add-label "needs-review"
149158
150159 # Set as ready for review
151- gh pr ready ${{ steps.check-pr.outputs.pr_number }} || true
160+ gh pr ready $PR_NUMBER || true
152161
153- echo "✅ Updated PR # ${{ steps.check-pr.outputs.pr_number }} with ${{ steps.commit-info.outputs.commit_count } } new commits"
162+ echo "✅ Updated PR # ${PR_NUMBER} with ${COMMIT_COUNT } new commits"
154163 env :
155164 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments