From a47ff911e1b08619fba18fa006cb0d7e551b8ae5 Mon Sep 17 00:00:00 2001 From: DevCats Date: Thu, 19 Jun 2025 16:35:10 -0500 Subject: [PATCH] fix: Version-Bump Workflow/Script - Formatting before diff (#155) ## Description Set up Pre-Req's, and ensure that formatting is done before checking diff since it likes to not respect prettier formatting. --- ## Type of Change - [ ] New module - [X] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other --- ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun run fmt`) - [ ] Changes tested locally --------- Co-authored-by: Atif Ali --- .github/scripts/version-bump.sh | 9 +++++++++ .github/workflows/version-bump.yaml | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/scripts/version-bump.sh b/.github/scripts/version-bump.sh index b074583d..095d1279 100755 --- a/.github/scripts/version-bump.sh +++ b/.github/scripts/version-bump.sh @@ -190,6 +190,15 @@ main() { done <<< "$modules" + # Always run formatter to ensure consistent formatting + echo "🔧 Running formatter to ensure consistent formatting..." + if command -v bun >/dev/null 2>&1; then + bun fmt >/dev/null 2>&1 || echo "⚠️ Warning: bun fmt failed, but continuing..." + else + echo "⚠️ Warning: bun not found, skipping formatting" + fi + echo "" + echo "📋 Summary:" echo "Bump Type: $bump_type" echo "" diff --git a/.github/workflows/version-bump.yaml b/.github/workflows/version-bump.yaml index 2d0e88dd..b492ffc5 100644 --- a/.github/workflows/version-bump.yaml +++ b/.github/workflows/version-bump.yaml @@ -25,6 +25,17 @@ jobs: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Set up Terraform + uses: coder/coder/.github/actions/setup-tf@main + + - name: Install dependencies + run: bun install + - name: Extract bump type from label id: bump-type run: |