diff --git a/.github/workflows/all-good.yaml b/.github/workflows/all-good.yaml index 91c314146..101ba521b 100644 --- a/.github/workflows/all-good.yaml +++ b/.github/workflows/all-good.yaml @@ -17,7 +17,7 @@ jobs: env: REPO: ${{ github.repository }} COMMIT: ${{ github.sha }} - PR_NUMBER: ${{ github.event.pull_request.number }} + PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} steps: - name: Wait for 60 seconds run: sleep 60 @@ -51,30 +51,31 @@ jobs: } while true; do + # Always check the current commit's checks commit_response=$(get_check_runs "https://api.github.com/repos/${REPO}/commits/${COMMIT}/check-runs") commit_total=$(echo "$commit_response" | jq -r '.total_count // 0') - # If this is a PR, also get PR check runs + # If this is a PR, check the PR's head commit checks pr_total=0 - if [ -n "$PR_NUMBER" ]; then - pr_response=$(get_check_runs "https://api.github.com/repos/${REPO}/pulls/${PR_NUMBER}/check-runs") + if [ -n "$PR_HEAD_SHA" ] && [ "$PR_HEAD_SHA" != "$COMMIT" ]; then + pr_response=$(get_check_runs "https://api.github.com/repos/${REPO}/commits/${PR_HEAD_SHA}/check-runs") pr_total=$(echo "$pr_response" | jq -r '.total_count // 0') - echo "Found ${commit_total} commit checks and ${pr_total} PR checks" + echo "Found ${commit_total} current commit checks and ${pr_total} PR head commit checks" else echo "Found ${commit_total} commit checks" fi # If no checks found at all, wait and retry - if [ "$commit_total" -eq 0 ] && { [ -z "$PR_NUMBER" ] || [ "$pr_total" -eq 0 ]; }; then + if [ "$commit_total" -eq 0 ] && { [ -z "$PR_HEAD_SHA" ] || [ "$pr_total" -eq 0 ]; }; then echo "No check runs found. Waiting..." sleep 10 continue fi - # Check for pending runs in both commit and PR checks + # Check for pending runs in both current and PR head commit checks commit_pending=$(count_pending_checks "$commit_response") pr_pending=0 - if [ -n "$PR_NUMBER" ]; then + if [ -n "$PR_HEAD_SHA" ] && [ "$PR_HEAD_SHA" != "$COMMIT" ]; then pr_pending=$(count_pending_checks "$pr_response") fi @@ -85,10 +86,10 @@ jobs: continue fi - # Check for failures in both commit and PR checks + # Check for failures in both current and PR head commit checks commit_failed=$(count_failed_checks "$commit_response") pr_failed=0 - if [ -n "$PR_NUMBER" ]; then + if [ -n "$PR_HEAD_SHA" ] && [ "$PR_HEAD_SHA" != "$COMMIT" ]; then pr_failed=$(count_failed_checks "$pr_response") fi diff --git a/.github/workflows/auto-update.yaml b/.github/workflows/auto-update.yaml index bdbdbcc26..07020b677 100644 --- a/.github/workflows/auto-update.yaml +++ b/.github/workflows/auto-update.yaml @@ -1,11 +1,8 @@ name: Update pull request branches on: - push: - branches: - - main - - dev - pull_request: + schedule: + - cron: '30 11 * * *' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/README.md b/README.md index 4b6e8ab09..9053b7785 100644 --- a/README.md +++ b/README.md @@ -134,10 +134,11 @@ pnpm install pnpm build:packages pnpm codegen -# Reset & start the dependencies (DB, Inbucket, etc.) as Docker containers, seeding the DB with the Prisma schema -pnpm start-deps -# pnpm run restart-deps -# pnpm run stop-deps +# Start the dependencies (DB, Inbucket, etc.) as Docker containers, seeding the DB with the Prisma schema +pnpm restart-deps +# restart-deps is the same as: +# pnpm run stop-deps (if the containers are already running) +# pnpm run start-deps # Start the dev server pnpm dev diff --git a/apps/backend/src/instrumentation.ts b/apps/backend/src/instrumentation.ts index e8644c10f..46619f21d 100644 --- a/apps/backend/src/instrumentation.ts +++ b/apps/backend/src/instrumentation.ts @@ -13,7 +13,7 @@ export function register() { }); if (getNextRuntime() === "nodejs") { - process.title = "stack-backend (nextjs)"; + process.title = "stack-backend (node/nextjs)"; } if (getNextRuntime() === "nodejs" || getNextRuntime() === "edge") { diff --git a/apps/dashboard/src/instrumentation.ts b/apps/dashboard/src/instrumentation.ts index 2a1471a50..b8cb81fa9 100644 --- a/apps/dashboard/src/instrumentation.ts +++ b/apps/dashboard/src/instrumentation.ts @@ -6,7 +6,7 @@ import "./polyfills"; export function register() { if (getNextRuntime() === "nodejs") { - process.title = "stack-dashboard (nextjs)"; + process.title = "stack-dashboard (node/nextjs)"; } if (getNextRuntime() === "nodejs" || getNextRuntime() === "edge") {