Skip to content

Commit d03ca17

Browse files
authored
Merge pull request #278 from vue-pivottable/develop
πŸ”„ Integrate develop β†’ staging
2 parents e0b8200 + da2bb7d commit d03ca17

File tree

3 files changed

+34
-70
lines changed

3 files changed

+34
-70
lines changed

β€Ž.github/workflows/integrate-develop.ymlβ€Ž

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
create-or-update-pr:
1414
name: Create or Update PR to Staging
1515
runs-on: ubuntu-latest
16+
# Skip if this is a sync commit from main
17+
if: "!contains(github.event.head_commit.message, 'chore: sync version updates from main')"
1618
permissions:
1719
contents: write
1820
pull-requests: write
@@ -128,8 +130,25 @@ jobs:
128130
# Get current PR body
129131
CURRENT_BODY=$(gh pr view $PR_NUMBER --json body --jq '.body')
130132
131-
# Create updated section
132-
UPDATED_SECTION="### πŸ”„ Last Updated: ${TIMESTAMP}\nNew commits: ${COMMIT_COUNT}\n\n### πŸ“ Recent Commits\n${COMMITS}"
133+
# Create updated section with escaped content
134+
cat > updated-section.md << 'EOF'
135+
### πŸ”„ Last Updated: TIMESTAMP_PLACEHOLDER
136+
New commits: COUNT_PLACEHOLDER
137+
138+
### πŸ“ Recent Commits
139+
COMMITS_PLACEHOLDER
140+
EOF
141+
142+
# Replace placeholders safely
143+
sed -i "s/TIMESTAMP_PLACEHOLDER/${TIMESTAMP}/g" updated-section.md
144+
sed -i "s/COUNT_PLACEHOLDER/${COMMIT_COUNT}/g" updated-section.md
145+
146+
# Process commits separately and safely
147+
echo "${COMMITS}" | sed 's/%0A/\n/g' | sed 's/%0D//g' | sed 's/%25/%/g' > commits-temp.txt
148+
sed -i '/COMMITS_PLACEHOLDER/r commits-temp.txt' updated-section.md
149+
sed -i '/COMMITS_PLACEHOLDER/d' updated-section.md
150+
151+
UPDATED_SECTION=$(cat updated-section.md)
133152

134153
# Update or append the updated section
135154
if echo "$CURRENT_BODY" | grep -q "### πŸ”„ Last Updated:"; then

β€Ž.github/workflows/pr-check.ymlβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ jobs:
4747
if [ -n "$(ls -A .changeset/*.md 2>/dev/null | grep -v README.md)" ]; then
4848
echo "βœ… Changeset found"
4949
else
50-
echo "⚠️ No changeset found. Please add a changeset with 'pnpm changeset add'"
51-
echo " This is required for all changes that affect published packages."
52-
exit 1
50+
echo "⚠️ No changeset found. Consider adding a changeset with 'pnpm changeset add'"
51+
echo " Changesets are recommended for changes that affect published packages."
52+
echo " (Not required for documentation, CI/CD, or other non-package changes)"
5353
fi
5454
5555
build:

β€Ž.github/workflows/update-version.ymlβ€Ž

Lines changed: 10 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -138,90 +138,35 @@ jobs:
138138
run: |
139139
echo "πŸ”„ Syncing changes to develop branch..."
140140
141-
# Fetch latest develop
141+
# Fetch and checkout develop
142142
git fetch origin develop:develop
143-
144-
# Create sync branch
145-
SYNC_BRANCH="sync/main-to-develop-$(date +%s)"
146-
git checkout -b $SYNC_BRANCH
143+
git checkout develop
147144
148145
# Merge main changes
149146
git merge main --no-ff -m "chore: sync version updates from main"
150147
151-
# Push sync branch
152-
git push origin $SYNC_BRANCH
153-
154-
# Create PR
155-
VERSION="${{ steps.version-update.outputs.version }}"
148+
# Push directly to develop
149+
git push origin develop
156150
157-
{
158-
echo "## πŸ”„ Version Sync from Main"
159-
echo ""
160-
echo "### πŸ“¦ Updated Versions"
161-
echo "This PR syncs the stable version updates from main to develop."
162-
echo ""
163-
echo "Version: **v$VERSION**"
164-
echo ""
165-
echo "### ⚑ Auto-merge"
166-
echo "This PR should be merged automatically to keep branches in sync."
167-
echo ""
168-
echo "---"
169-
echo "*This PR was automatically created by the version update workflow*"
170-
} > pr-body.md
171-
172-
gh pr create \
173-
--base develop \
174-
--head $SYNC_BRANCH \
175-
--title "πŸ”„ Sync: main β†’ develop (v$VERSION)" \
176-
--body-file pr-body.md \
177-
--label "auto-updated"
151+
echo "βœ… Successfully synced main to develop"
178152
env:
179153
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
180154

181155
- name: Sync to staging
182156
run: |
183157
echo "πŸ”„ Syncing changes to staging branch..."
184158
185-
# Checkout main again
186-
git checkout main
187-
188-
# Fetch latest staging
159+
# Fetch and checkout staging
189160
git fetch origin staging:staging
190-
191-
# Create sync branch
192-
SYNC_BRANCH="sync/main-to-staging-$(date +%s)"
193-
git checkout -b $SYNC_BRANCH
161+
git checkout staging
194162
195163
# Merge main changes
196164
git merge main --no-ff -m "chore: sync version updates from main"
197165
198-
# Push sync branch
199-
git push origin $SYNC_BRANCH
200-
201-
# Create PR
202-
VERSION="${{ steps.version-update.outputs.version }}"
166+
# Push directly to staging
167+
git push origin staging
203168
204-
{
205-
echo "## πŸ”„ Version Sync from Main"
206-
echo ""
207-
echo "### πŸ“¦ Updated Versions"
208-
echo "This PR syncs the stable version updates from main to staging."
209-
echo ""
210-
echo "Version: **v$VERSION**"
211-
echo ""
212-
echo "### ⚑ Auto-merge"
213-
echo "This PR should be merged automatically to keep branches in sync."
214-
echo ""
215-
echo "---"
216-
echo "*This PR was automatically created by the version update workflow*"
217-
} > pr-body-staging.md
218-
219-
gh pr create \
220-
--base staging \
221-
--head $SYNC_BRANCH \
222-
--title "πŸ”„ Sync: main β†’ staging (v$VERSION)" \
223-
--body-file pr-body-staging.md \
224-
--label "auto-updated"
169+
echo "βœ… Successfully synced main to staging"
225170
env:
226171
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
227172

0 commit comments

Comments
Β (0)