From 2df201da14fde6017a61713d9c92306231e6fca8 Mon Sep 17 00:00:00 2001 From: Mumtahin Farabi Date: Sun, 1 Dec 2024 16:38:50 -0500 Subject: [PATCH] ci(build): fix pipeline failing due to unspecified base and head --- .github/workflows/BUILD.yml | 38 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/BUILD.yml b/.github/workflows/BUILD.yml index 8423cb55..01524446 100644 --- a/.github/workflows/BUILD.yml +++ b/.github/workflows/BUILD.yml @@ -17,7 +17,13 @@ jobs: - name: ๐Ÿ›Ž๏ธ Checkout Code uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clone (only take latest commit) + fetch-depth: 0 # Fetch all history for all branches and tags to ensure the 'main' branch is available + + - name: Fetch main branch + run: git fetch origin main:main # Explicitly fetch the 'main' branch to ensure it's available + + - name: List all branches + run: git branch -a # Debugging step to list all branches fetched in the runner - name: ๐Ÿ“ฆ Install pnpm uses: pnpm/action-setup@v4 @@ -27,29 +33,19 @@ jobs: with: node-version: 20 + - name: Debug Git Status + run: | + git status # Show the current branch and changes + git branch -a # List all local and remote branches + git log -1 # Show the last commit for debug purposes + - name: ๐Ÿงน Lint Projects - # run: pnpm i; pnpm nx run-many -t lint -p docs docs-e2e website website-e2e portal portal-e2e --verbose - run: pnpm i; pnpm nx affected -t lint --verbose + run: pnpm i; pnpm nx affected -t lint --base=origin/main --head=HEAD --verbose + # Use 'origin/main' to reference the exact remote branch - name: ๐Ÿ—๏ธ Build Affected Projects - run: pnpm nx affected -t build --verbose - - # - name: ๐ŸŽญ Install Playwright Browsers - # run: pnpm playwright install --with-deps - - # - name: ๐Ÿ“š Build Docs - # run: pnpm nx build docs --verbose - - # - name: ๐ŸŒ Build Website - # run: pnpm nx build website --verbose - - # - name: ๐ŸŒ€ Build Portal - # env: - # DATABASE_URL: ${{ secrets.DATABASE_URL }} - # AUTH_SECRET: ${{ secrets.AUTH_SECRET }} - # GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} - # GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} - # run: pnpm nx build portal --verbose + run: pnpm nx affected -t build --base=origin/main --head=HEAD --verbose + # Ensure the base is set to 'origin/main' to avoid any ambiguity about the branch - name: ๐Ÿ’ฐ Profit run: echo ๐Ÿž