Skip to content

refactor: replace inline chart implementation with dynamic EarningsCh… #189

refactor: replace inline chart implementation with dynamic EarningsCh…

refactor: replace inline chart implementation with dynamic EarningsCh… #189

# name: Build and Merge
# on:
# pull_request:
# types: [opened, synchronize, reopened, ready_for_review]
# jobs:
# build:
# name: Build Application
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# with:
# ref: ${{ github.head_ref }}
# token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
# node-version: "18"
# cache: "yarn"
# - name: Setup Bun
# uses: oven-sh/setup-bun@v1
# with:
# bun-version: latest
# - name: Cache Bun dependencies
# id: cache-deps
# uses: actions/cache@v4
# with:
# path: ~/.bun/install/cache
# key: ${{ runner.os }}-bun-dependencies-${{ hashFiles('**/bun.lockb') }}
# restore-keys: |
# ${{ runner.os }}-bun-dependencies-
# - name: Install root dependencies
# run: bun install
# - name: Install design system dependencies
# run: |
# cd packages/design-system
# yarn install
# yarn add -D ts-node typescript
# - name: Install global tools
# run: |
# npm install -g turbo
# npm install -g ts-node
# - name: Build design system first
# run: |
# cd packages/design-system
# yarn build || npx ts-node src/scripts/build.ts
# - name: Type checking
# run: bun run type-checks || npx turbo build check-types
# - name: Build application
# run: bun run build || npx turbo build
# merge-pr:
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Check PR Author
# id: check-author
# run: |
# PR_AUTHOR="${{ github.event.pull_request.user.login }}"
# echo "PR_AUTHOR=${PR_AUTHOR}" >> $GITHUB_ENV
# if [[ "$PR_AUTHOR" == "mrbadri" ]]; then
# echo "MERGE_IMMEDIATELY=true" >> $GITHUB_ENV
# else
# echo "MERGE_IMMEDIATELY=false" >> $GITHUB_ENV
# fi
# - name: Wait for Approval (if not mrbadri)
# id: check-approval
# if: env.MERGE_IMMEDIATELY == 'false'
# run: |
# APPROVED=0
# while [ $APPROVED -eq 0 ]; do
# echo "Checking for approvals..."
# REVIEWS=$(curl -s -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews)
# if echo "$REVIEWS" | grep -q '"state": "APPROVED"'; then
# APPROVED=1
# echo "Pull request has at least one approval!"
# else
# echo "Waiting for at least one approval..."
# sleep 60
# fi
# done
# - name: Merge Pull Request
# run: |
# curl -X PUT -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/merge \
# -d '{"merge_method":"squash"}'