Skip to content

D1 migrations in CI fail silently #221

Description

@davwheat

I have no idea if this is a me problem like some misconfiguration I've made, but I can't work this out for the life of me.

Excerpt from my workflow:

      - name: Deploy worker
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          workingDirectory: 'cf-workers'

      - name: Run D1 migrations
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          workingDirectory: 'cf-workers'
          command: d1 migrations apply rail-announcements

Deploying the worker is fine, but the migrations command returns error code 1 with no useful log output:

🚀 Running Wrangler Commands
  /usr/local/bin/yarn wrangler d1 migrations apply rail-announcements
Error: The process '/usr/local/bin/yarn' failed with exit code 1
Error: 🚨 Action failed

Running it locally works fine, with the CLI output I'd expect:

ubuntu@David-PC:~/rail-announcements/cf-workers$ yarn wrangler d1 migrations apply rail-announcements
✅ No migrations to apply!

Any ideas what I might be doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions