Skip to content

Commit

Permalink
ci(build): fix pipeline failing due to unspecified base and head
Browse files Browse the repository at this point in the history
  • Loading branch information
MFarabi619 committed Dec 1, 2024
1 parent 0c90247 commit 2df201d
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions .github/workflows/BUILD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 🐞

0 comments on commit 2df201d

Please sign in to comment.