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
23 changes: 21 additions & 2 deletions .github/workflows/integrate-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
create-or-update-pr:
name: Create or Update PR to Staging
runs-on: ubuntu-latest
# Skip if this is a sync commit from main
if: "!contains(github.event.head_commit.message, 'chore: sync version updates from main')"
permissions:
contents: write
pull-requests: write
Expand Down Expand Up @@ -128,8 +130,25 @@ jobs:
# Get current PR body
CURRENT_BODY=$(gh pr view $PR_NUMBER --json body --jq '.body')
# Create updated section
UPDATED_SECTION="### πŸ”„ Last Updated: ${TIMESTAMP}\nNew commits: ${COMMIT_COUNT}\n\n### πŸ“ Recent Commits\n${COMMITS}"
# Create updated section with escaped content
cat > updated-section.md << 'EOF'
### πŸ”„ Last Updated: TIMESTAMP_PLACEHOLDER
New commits: COUNT_PLACEHOLDER

### πŸ“ Recent Commits
COMMITS_PLACEHOLDER
EOF

# Replace placeholders safely
sed -i "s/TIMESTAMP_PLACEHOLDER/${TIMESTAMP}/g" updated-section.md
sed -i "s/COUNT_PLACEHOLDER/${COMMIT_COUNT}/g" updated-section.md

# Process commits separately and safely
echo "${COMMITS}" | sed 's/%0A/\n/g' | sed 's/%0D//g' | sed 's/%25/%/g' > commits-temp.txt
sed -i '/COMMITS_PLACEHOLDER/r commits-temp.txt' updated-section.md
sed -i '/COMMITS_PLACEHOLDER/d' updated-section.md

UPDATED_SECTION=$(cat updated-section.md)

# Update or append the updated section
if echo "$CURRENT_BODY" | grep -q "### πŸ”„ Last Updated:"; then
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
if [ -n "$(ls -A .changeset/*.md 2>/dev/null | grep -v README.md)" ]; then
echo "βœ… Changeset found"
else
echo "⚠️ No changeset found. Please add a changeset with 'pnpm changeset add'"
echo " This is required for all changes that affect published packages."
exit 1
echo "⚠️ No changeset found. Consider adding a changeset with 'pnpm changeset add'"
echo " Changesets are recommended for changes that affect published packages."
echo " (Not required for documentation, CI/CD, or other non-package changes)"
fi
build:
Expand Down
75 changes: 10 additions & 65 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,90 +138,35 @@ jobs:
run: |
echo "πŸ”„ Syncing changes to develop branch..."

# Fetch latest develop
# Fetch and checkout develop
git fetch origin develop:develop

# Create sync branch
SYNC_BRANCH="sync/main-to-develop-$(date +%s)"
git checkout -b $SYNC_BRANCH
git checkout develop

# Merge main changes
git merge main --no-ff -m "chore: sync version updates from main"

# Push sync branch
git push origin $SYNC_BRANCH

# Create PR
VERSION="${{ steps.version-update.outputs.version }}"
# Push directly to develop
git push origin develop

{
echo "## πŸ”„ Version Sync from Main"
echo ""
echo "### πŸ“¦ Updated Versions"
echo "This PR syncs the stable version updates from main to develop."
echo ""
echo "Version: **v$VERSION**"
echo ""
echo "### ⚑ Auto-merge"
echo "This PR should be merged automatically to keep branches in sync."
echo ""
echo "---"
echo "*This PR was automatically created by the version update workflow*"
} > pr-body.md

gh pr create \
--base develop \
--head $SYNC_BRANCH \
--title "πŸ”„ Sync: main β†’ develop (v$VERSION)" \
--body-file pr-body.md \
--label "auto-updated"
echo "βœ… Successfully synced main to develop"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Sync to staging
run: |
echo "πŸ”„ Syncing changes to staging branch..."

# Checkout main again
git checkout main

# Fetch latest staging
# Fetch and checkout staging
git fetch origin staging:staging

# Create sync branch
SYNC_BRANCH="sync/main-to-staging-$(date +%s)"
git checkout -b $SYNC_BRANCH
git checkout staging

# Merge main changes
git merge main --no-ff -m "chore: sync version updates from main"

# Push sync branch
git push origin $SYNC_BRANCH

# Create PR
VERSION="${{ steps.version-update.outputs.version }}"
# Push directly to staging
git push origin staging

{
echo "## πŸ”„ Version Sync from Main"
echo ""
echo "### πŸ“¦ Updated Versions"
echo "This PR syncs the stable version updates from main to staging."
echo ""
echo "Version: **v$VERSION**"
echo ""
echo "### ⚑ Auto-merge"
echo "This PR should be merged automatically to keep branches in sync."
echo ""
echo "---"
echo "*This PR was automatically created by the version update workflow*"
} > pr-body-staging.md

gh pr create \
--base staging \
--head $SYNC_BRANCH \
--title "πŸ”„ Sync: main β†’ staging (v$VERSION)" \
--body-file pr-body-staging.md \
--label "auto-updated"
echo "βœ… Successfully synced main to staging"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down