Postgres service fails for Dependabot PRs

Hi there,

I have set up a GitHub Actions workflow on my private repo, which works fine whenever I push commits or create a PR myself; however, it always fails when it is Dependabot that creates a dependency-update PR: the “Initialize containers” fails with this error:

Waiting for all services to be ready
  /usr/bin/docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" 8e93019f1c57ba59e275aa8ef1583b7300ee71d6bba16c21d1fca92ae1027bfe
  unhealthy
  Error: Failed to initialize, postgres service is unhealthy.

Then, if I click on “Re-run jobs” manually, the workflow runs fine. Any idea on what could be the cause?

My GH Actions workflow details:

name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

  workflow_dispatch:

jobs:
  all:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:13
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: ${{ secrets.PG_POSTGRES_PASSWORD }}
          POSTGRES_DB: vasqo_test
        ports:
          - 5432:5432
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    env:
      ...
      PG_POSTGRES_PASSWORD: ${{ secrets.PG_POSTGRES_PASSWORD }}
      ...
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Use Node.js v${{ env.NODE_VERSION }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ env.NODE_VERSION }}
      ...

Presumably you’re hitting this:

Thanks a lot, I was able to solve the issue!