From 12272310df81bdeacd18d3e92f94cba281c8521d Mon Sep 17 00:00:00 2001 From: Seungwoo321 Date: Tue, 5 Aug 2025 19:31:24 +0900 Subject: [PATCH 1/2] fix: add missing newlines at end of workflow files This fixes YAML parsing errors that caused workflow failures --- .github/workflows/integrate-develop.yml | 2 +- .github/workflows/release-staging.yml | 2 +- .github/workflows/release-tag.yml | 2 +- .github/workflows/update-version.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integrate-develop.yml b/.github/workflows/integrate-develop.yml index 0a506dd..dff4779 100644 --- a/.github/workflows/integrate-develop.yml +++ b/.github/workflows/integrate-develop.yml @@ -154,4 +154,4 @@ jobs: echo "✅ Updated PR #${PR_NUMBER} with ${COMMIT_COUNT} new commits" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index f5b2bac..c875ecb 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -259,4 +259,4 @@ EOF gh pr edit $PR_NUMBER \ --add-label "needs-review" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 5cffe31..4c9fcfe 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -182,4 +182,4 @@ EOF echo "${{ steps.publish.outputs.published_packages }}" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### 🔗 View Release" >> $GITHUB_STEP_SUMMARY - echo "[GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag-info.outputs.tag }})" >> $GITHUB_STEP_SUMMARY \ No newline at end of file + echo "[GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag-info.outputs.tag }})" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 8baa775..eeaec8e 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -244,4 +244,4 @@ jobs: echo "" >> $GITHUB_STEP_SUMMARY echo "### 🔄 Sync PRs Created" >> $GITHUB_STEP_SUMMARY echo "- PR to develop branch" >> $GITHUB_STEP_SUMMARY - echo "- PR to staging branch" >> $GITHUB_STEP_SUMMARY \ No newline at end of file + echo "- PR to staging branch" >> $GITHUB_STEP_SUMMARY From b54df45a7a591acd0e7ec0067232151886e651c8 Mon Sep 17 00:00:00 2001 From: Seungwoo321 Date: Tue, 5 Aug 2025 19:37:49 +0900 Subject: [PATCH 2/2] fix: resolve all YAML syntax errors in workflow files - Fixed heredoc syntax issues in release-staging.yml and release-tag.yml - Replaced problematic heredoc blocks with echo commands in braces - Added missing newline at end of pr-check.yml - Removed all trailing spaces from workflow files - All workflows now pass yamllint validation without errors --- .github/workflows/integrate-develop.yml | 30 ++--- .github/workflows/pr-check.yml | 6 +- .github/workflows/release-staging.yml | 163 ++++++++++++------------ .github/workflows/release-tag.yml | 81 ++++++------ .github/workflows/update-version.yml | 46 +++---- 5 files changed, 167 insertions(+), 159 deletions(-) diff --git a/.github/workflows/integrate-develop.yml b/.github/workflows/integrate-develop.yml index dff4779..03c1742 100644 --- a/.github/workflows/integrate-develop.yml +++ b/.github/workflows/integrate-develop.yml @@ -31,7 +31,7 @@ jobs: id: check-pr run: | EXISTING_PR=$(gh pr list --base staging --head develop --json number --jq '.[0].number' || echo "") - + if [ -n "$EXISTING_PR" ]; then echo "pr_exists=true" >> $GITHUB_OUTPUT echo "pr_number=$EXISTING_PR" >> $GITHUB_OUTPUT @@ -48,7 +48,7 @@ jobs: run: | # Fetch staging branch git fetch origin staging:staging || echo "Staging branch not found" - + # Get the latest commits from develop that aren't in staging if git rev-parse --verify origin/staging >/dev/null 2>&1; then COMMITS=$(git log --pretty=format:"- %s (%h)" origin/staging..HEAD | head -20) @@ -57,17 +57,17 @@ jobs: COMMITS=$(git log --pretty=format:"- %s (%h)" HEAD | head -20) COMMIT_COUNT=$(git rev-list --count HEAD) fi - + # Escape for GitHub Actions output COMMITS="${COMMITS//'%'/'%25'}" COMMITS="${COMMITS//$'\n'/'%0A'}" COMMITS="${COMMITS//$'\r'/'%0D'}" - + echo "commits<> $GITHUB_OUTPUT echo "$COMMITS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT echo "commit_count=$COMMIT_COUNT" >> $GITHUB_OUTPUT - + # Get timestamp TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC") echo "timestamp=$TIMESTAMP" >> $GITHUB_OUTPUT @@ -77,7 +77,7 @@ jobs: run: | COMMIT_COUNT="${{ steps.commit-info.outputs.commit_count }}" TIMESTAMP="${{ steps.commit-info.outputs.timestamp }}" - + # Create PR body file { echo "## 🚀 Integration from develop to staging" @@ -103,7 +103,7 @@ jobs: echo "- Multiple features can accumulate in this single PR" echo "- Approval triggers the beta release process" } > pr-body.md - + gh pr create \ --base staging \ --head develop \ @@ -120,17 +120,17 @@ jobs: COMMIT_COUNT="${{ steps.commit-info.outputs.commit_count }}" TIMESTAMP="${{ steps.commit-info.outputs.timestamp }}" COMMITS="${{ steps.commit-info.outputs.commits }}" - + # Update PR title with commit count gh pr edit $PR_NUMBER \ --title "🔄 Integrate develop → staging (${COMMIT_COUNT} commits)" - + # 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}" - + # Update or append the updated section if echo "$CURRENT_BODY" | grep -q "### 🔄 Last Updated:"; then # Replace existing update section @@ -140,18 +140,18 @@ jobs: # Append update section NEW_BODY="$CURRENT_BODY\n\n---\n\n$UPDATED_SECTION" fi - + # Update PR body echo "$NEW_BODY" > pr-body-update.md gh pr edit $PR_NUMBER --body-file pr-body-update.md - + # Add labels gh pr edit $PR_NUMBER \ --add-label "needs-review" - + # Set as ready for review gh pr ready $PR_NUMBER || true - + echo "✅ Updated PR #${PR_NUMBER} with ${COMMIT_COUNT} new commits" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 2bb2c91..b3c6807 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -82,7 +82,7 @@ jobs: echo "❌ Main package build output not found" exit 1 fi - + # Check sub-packages for pkg in packages/*/; do if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then @@ -92,5 +92,5 @@ jobs: fi fi done - - echo "✅ All packages built successfully" \ No newline at end of file + + echo "✅ All packages built successfully" diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index c875ecb..c769353 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -67,7 +67,7 @@ jobs: echo "Running type checks..." pnpm typecheck pnpm -r typecheck || true - + echo "Running linting..." pnpm lint pnpm -r lint || true @@ -78,13 +78,13 @@ jobs: # Configure git git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - + # Run changesets version with beta pnpm changeset version - + # Add beta suffix to all updated packages TIMESTAMP=$(date +%s) - + # Update main package if version changed if git diff --name-only | grep -q "^package.json$"; then CURRENT_VERSION=$(node -p "require('./package.json').version") @@ -92,7 +92,7 @@ jobs: npm version $BETA_VERSION --no-git-tag-version echo "Main package: $CURRENT_VERSION → $BETA_VERSION" fi - + # Update sub-packages if versions changed for pkg in packages/*/; do if [ -d "$pkg" ] && git diff --name-only | grep -q "^$pkg"; then @@ -107,7 +107,7 @@ jobs: cd - > /dev/null fi done - + # Commit all changes git add -A git commit -m "chore: version packages for beta release" || echo "No changes to commit" @@ -122,15 +122,15 @@ jobs: run: | # Publish with beta tag RELEASE_TAG=beta node scripts/release-packages.cjs - + # Collect published versions echo "published_versions<> $GITHUB_OUTPUT echo "### Published Beta Versions" >> $GITHUB_OUTPUT - + # Check main package MAIN_VERSION=$(node -p "require('./package.json').version") echo "- vue-pivottable@$MAIN_VERSION" >> $GITHUB_OUTPUT - + # Check sub-packages for pkg in packages/*/; do if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then @@ -153,7 +153,7 @@ jobs: id: check-pr run: | EXISTING_PR=$(gh pr list --base main --head staging --json number --jq '.[0].number' || echo "") - + if [ -n "$EXISTING_PR" ]; then echo "pr_exists=true" >> $GITHUB_OUTPUT echo "pr_number=$EXISTING_PR" >> $GITHUB_OUTPUT @@ -168,42 +168,48 @@ jobs: run: | # Get the main package version for PR title MAIN_VERSION=$(node -p "require('./package.json').version") - + PUBLISHED_VERSIONS="${{ steps.publish.outputs.published_versions }}" + + # Create PR body file + { + echo "## 🎯 Beta Release Ready for Production" + echo "" + echo "$PUBLISHED_VERSIONS" + echo "" + echo "### 📋 What happens next?" + echo "1. Review and test the beta versions" + echo "2. When approved and merged, this will:" + echo " - Update package.json versions (remove beta suffix)" + echo " - Generate/update CHANGELOG.md files" + echo " - Sync changes back to develop and staging" + echo " - **Note**: npm publish happens only when you create a version tag" + echo "" + echo "### 🏷️ After merge:" + echo "Create a version tag to trigger production release:" + echo '```bash' + echo "git checkout main" + echo "git pull origin main" + echo "git tag v\${VERSION}" + echo "git push origin v\${VERSION}" + echo '```' + echo "" + echo "### 📦 Install beta versions:" + echo '```bash' + echo "npm install vue-pivottable@beta" + echo "# or specific sub-packages" + echo "npm install @vue-pivottable/plotly-renderer@beta" + echo "npm install @vue-pivottable/lazy-table-renderer@beta" + echo '```' + echo "" + echo "---" + echo "*This PR was automatically created by the staging release workflow*" + } > pr-body.md + gh pr create \ --base main \ --head staging \ --title "🚀 Release: Beta versions ready for production" \ - --body "## 🎯 Beta Release Ready for Production - -${{ steps.publish.outputs.published_versions }} - -### 📋 What happens next? -1. Review and test the beta versions -2. When approved and merged, this will: - - Update package.json versions (remove beta suffix) - - Generate/update CHANGELOG.md files - - Sync changes back to develop and staging - - **Note**: npm publish happens only when you create a version tag - -### 🏷️ After merge: -Create a version tag to trigger production release: -\`\`\`bash -git checkout main -git pull origin main -git tag v\${VERSION} -git push origin v\${VERSION} -\`\`\` - -### 📦 Install beta versions: -\`\`\`bash -npm install vue-pivottable@beta -# or specific sub-packages -npm install @vue-pivottable/plotly-renderer@beta -npm install @vue-pivottable/lazy-table-renderer@beta -\`\`\` - ---- -*This PR was automatically created by the staging release workflow*" \ + --body-file pr-body.md \ --label "released" \ --label "auto-updated" env: @@ -215,46 +221,47 @@ npm install @vue-pivottable/lazy-table-renderer@beta TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC") PR_NUMBER="${{ steps.check-pr.outputs.pr_number }}" PUBLISHED_VERSIONS="${{ steps.publish.outputs.published_versions }}" - - cat > pr-body-update.md << EOF -## 🎯 Beta Release Ready for Production -### ⏰ Last Updated: $TIMESTAMP + # Create updated PR body + { + echo "## 🎯 Beta Release Ready for Production" + echo "" + echo "### ⏰ Last Updated: $TIMESTAMP" + echo "" + echo "$PUBLISHED_VERSIONS" + echo "" + echo "### 📋 What happens next?" + echo "1. Review and test the beta versions" + echo "2. When approved and merged, this will:" + echo " - Update package.json versions (remove beta suffix)" + echo " - Generate/update CHANGELOG.md files" + echo " - Sync changes back to develop and staging" + echo " - **Note**: npm publish happens only when you create a version tag" + echo "" + echo "### 🏷️ After merge:" + echo "Create a version tag to trigger production release:" + echo '```bash' + echo "git checkout main" + echo "git pull origin main" + echo "git tag v\${VERSION}" + echo "git push origin v\${VERSION}" + echo '```' + echo "" + echo "### 📦 Install beta versions:" + echo '```bash' + echo "npm install vue-pivottable@beta" + echo "# or specific sub-packages" + echo "npm install @vue-pivottable/plotly-renderer@beta" + echo "npm install @vue-pivottable/lazy-table-renderer@beta" + echo '```' + echo "" + echo "---" + echo "*This PR was automatically updated by the staging release workflow*" + } > pr-body-update.md -$PUBLISHED_VERSIONS - -### 📋 What happens next? -1. Review and test the beta versions -2. When approved and merged, this will: - - Update package.json versions (remove beta suffix) - - Generate/update CHANGELOG.md files - - Sync changes back to develop and staging - - **Note**: npm publish happens only when you create a version tag - -### 🏷️ After merge: -Create a version tag to trigger production release: -\`\`\`bash -git checkout main -git pull origin main -git tag v\${VERSION} -git push origin v\${VERSION} -\`\`\` - -### 📦 Install beta versions: -\`\`\`bash -npm install vue-pivottable@beta -# or specific sub-packages -npm install @vue-pivottable/plotly-renderer@beta -npm install @vue-pivottable/lazy-table-renderer@beta -\`\`\` - ---- -*This PR was automatically updated by the staging release workflow* -EOF - # Update PR body with new beta versions gh pr edit $PR_NUMBER --body-file pr-body-update.md - + # Update labels gh pr edit $PR_NUMBER \ --add-label "needs-review" diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 4c9fcfe..408c0ad 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -25,17 +25,17 @@ jobs: run: | TAG_NAME=${GITHUB_REF#refs/tags/} echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT - + # Extract version from tag VERSION=${TAG_NAME#v} echo "version=$VERSION" >> $GITHUB_OUTPUT - + # Validate version format if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then echo "❌ Invalid version format: $VERSION" exit 1 fi - + echo "✅ Valid tag: $TAG_NAME (version: $VERSION)" - name: Setup Node.js @@ -55,7 +55,7 @@ jobs: - name: Verify versions match run: | TAG_VERSION="${{ steps.tag-info.outputs.version }}" - + # Check main package version MAIN_VERSION=$(node -p "require('./package.json').version") if [ "$MAIN_VERSION" != "$TAG_VERSION" ]; then @@ -70,7 +70,7 @@ jobs: echo "Running type checks..." pnpm typecheck pnpm -r typecheck || true - + echo "Running linting..." pnpm lint pnpm -r lint || true @@ -84,17 +84,17 @@ jobs: id: publish run: | echo "Publishing packages with @latest tag..." - + # Publish packages node scripts/release-packages.cjs - + # Collect published packages echo "published_packages<> $GITHUB_OUTPUT - + # Check which packages were published MAIN_VERSION=$(node -p "require('./package.json').version") echo "- vue-pivottable@$MAIN_VERSION" >> $GITHUB_OUTPUT - + for pkg in packages/*/; do if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then PKG_NAME=$(cd "$pkg" && node -p "require('./package.json').name") @@ -113,22 +113,22 @@ jobs: run: | # Try to extract release notes from CHANGELOG.md NOTES="" - + if [ -f "CHANGELOG.md" ]; then # Extract notes for this version VERSION="${{ steps.tag-info.outputs.version }}" NOTES=$(awk "/^## $VERSION/,/^## [0-9]/" CHANGELOG.md | sed '1d;$d' | head -n 20) fi - + if [ -z "$NOTES" ]; then NOTES="See CHANGELOG.md for details" fi - + # Escape for GitHub Actions NOTES="${NOTES//'%'/'%25'}" NOTES="${NOTES//$'\n'/'%0A'}" NOTES="${NOTES//$'\r'/'%0D'}" - + echo "notes<> $GITHUB_OUTPUT echo "$NOTES" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT @@ -139,33 +139,34 @@ jobs: VERSION="${{ steps.tag-info.outputs.version }}" PUBLISHED_PACKAGES="${{ steps.publish.outputs.published_packages }}" RELEASE_NOTES="${{ steps.release-notes.outputs.notes }}" - - cat > release-notes.md << EOF -## 🚀 Production Release $VERSION - -### 📦 Published Packages -$PUBLISHED_PACKAGES - -### 📝 Release Notes -$RELEASE_NOTES - -### 💻 Installation -\`\`\`bash -npm install vue-pivottable@latest -# or specific packages -npm install @vue-pivottable/plotly-renderer@latest -npm install @vue-pivottable/lazy-table-renderer@latest -\`\`\` - -### 🔗 Links -- [npm: vue-pivottable](https://www.npmjs.com/package/vue-pivottable) -- [npm: @vue-pivottable/plotly-renderer](https://www.npmjs.com/package/@vue-pivottable/plotly-renderer) -- [npm: @vue-pivottable/lazy-table-renderer](https://www.npmjs.com/package/@vue-pivottable/lazy-table-renderer) - ---- -*Released by GitHub Actions* -EOF - + + # Create release notes file + { + echo "## 🚀 Production Release $VERSION" + echo "" + echo "### 📦 Published Packages" + echo "$PUBLISHED_PACKAGES" + echo "" + echo "### 📝 Release Notes" + echo "$RELEASE_NOTES" + echo "" + echo "### 💻 Installation" + echo '```bash' + echo "npm install vue-pivottable@latest" + echo "# or specific packages" + echo "npm install @vue-pivottable/plotly-renderer@latest" + echo "npm install @vue-pivottable/lazy-table-renderer@latest" + echo '```' + echo "" + echo "### 🔗 Links" + echo "- [npm: vue-pivottable](https://www.npmjs.com/package/vue-pivottable)" + echo "- [npm: @vue-pivottable/plotly-renderer](https://www.npmjs.com/package/@vue-pivottable/plotly-renderer)" + echo "- [npm: @vue-pivottable/lazy-table-renderer](https://www.npmjs.com/package/@vue-pivottable/lazy-table-renderer)" + echo "" + echo "---" + echo "*Released by GitHub Actions*" + } > release-notes.md + gh release create "$TAG" \ --title "Release $TAG" \ --notes-file release-notes.md diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index eeaec8e..11a1333 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -27,7 +27,7 @@ jobs: run: | HAS_BETA=false BASE_VERSION="" - + # Check main package MAIN_VERSION=$(node -p "require('./package.json').version") if [[ $MAIN_VERSION == *"-beta"* ]]; then @@ -35,7 +35,7 @@ jobs: BASE_VERSION=$(echo $MAIN_VERSION | sed 's/-beta.*//') echo "Found beta in main package: $MAIN_VERSION → $BASE_VERSION" fi - + # Check sub-packages for pkg in packages/*/; do if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then @@ -48,7 +48,7 @@ jobs: fi fi done - + echo "has_beta=$HAS_BETA" >> $GITHUB_OUTPUT echo "base_version=$BASE_VERSION" >> $GITHUB_OUTPUT @@ -89,10 +89,10 @@ jobs: id: version-update run: | echo "📝 Updating package versions..." - + # Use changeset version to update versions properly pnpm changeset version - + # Remove any remaining beta suffixes # Update main package MAIN_VERSION=$(node -p "require('./package.json').version") @@ -101,7 +101,7 @@ jobs: npm version $CLEAN_VERSION --no-git-tag-version echo "Updated main package to $CLEAN_VERSION" fi - + # Update sub-packages for pkg in packages/*/; do if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then @@ -116,7 +116,7 @@ jobs: cd - > /dev/null fi done - + # Get final version for output FINAL_VERSION=$(node -p "require('./package.json').version") echo "version=$FINAL_VERSION" >> $GITHUB_OUTPUT @@ -137,23 +137,23 @@ jobs: - name: Sync to develop run: | echo "🔄 Syncing changes to develop branch..." - + # Fetch latest develop git fetch origin develop:develop - + # Create sync branch SYNC_BRANCH="sync/main-to-develop-$(date +%s)" git checkout -b $SYNC_BRANCH - + # 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 }}" - + { echo "## 🔄 Version Sync from Main" echo "" @@ -168,7 +168,7 @@ jobs: echo "---" echo "*This PR was automatically created by the version update workflow*" } > pr-body.md - + gh pr create \ --base develop \ --head $SYNC_BRANCH \ @@ -181,26 +181,26 @@ jobs: - name: Sync to staging run: | echo "🔄 Syncing changes to staging branch..." - + # Checkout main again git checkout main - + # Fetch latest staging git fetch origin staging:staging - + # Create sync branch SYNC_BRANCH="sync/main-to-staging-$(date +%s)" git checkout -b $SYNC_BRANCH - + # 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 }}" - + { echo "## 🔄 Version Sync from Main" echo "" @@ -215,7 +215,7 @@ jobs: echo "---" echo "*This PR was automatically created by the version update workflow*" } > pr-body-staging.md - + gh pr create \ --base staging \ --head $SYNC_BRANCH \ @@ -228,7 +228,7 @@ jobs: - name: Create release summary run: | VERSION="${{ steps.version-update.outputs.version }}" - + echo "## ✅ Version Update Complete" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### 📦 Version: v$VERSION" >> $GITHUB_STEP_SUMMARY