delete-branch-action github action is flakey

I have the following github workflow, which gives me the error. However, this error is flakey and only sometimes shows up. Why??

ERROR: Not enough non-option arguments: got 0, need at least 1
Error: Process completed with exit code 1.


name: Factors Testing
on: pull_request

jobs:
  factors-testing:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          lfs: true

      # Doppler setup
      - name: Setup Doppler
        uses: dopplerhq/secrets-fetch-action@v1.2.0
        id: doppler
        with:
          doppler-token: ${{ secrets.DOPPLER_CI_SERVICE_TOKEN }}
          inject-env-vars: true

      - name: Use Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'yarn'
          registry-url: 'https://npm.pkg.github.com'

      - name: Install Dependencies
        run: yarn install --frozen-lockfile
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

      - name: Create Neon Feature Branch
        uses: neondatabase/create-branch-action@v5
        id: create-feat-branch
        with:
            project_id: xxxxx
            database: xxxxx
            username: xxxxx 
            branch_name: ${GITHUB_REF_NAME}
            api_key: ${{ secrets.NEON_API_KEY }}

      - name: Set Neon Database URL for Testing
        run: echo "NEON_DATABASE_URL=${{ steps.create-feat-branch.outputs.db_url }}?sslmode=require" >> $GITHUB_ENV;

      - name: Run Integration Tests
        run: yarn test:integration

      - name: Delete Feature Branch
        if: always()
        uses: neondatabase/delete-branch-action@v3
        id: delete-feature-branch
        with:
          project_id: xxxxx
          branch: ${{ steps.create-feat-branch.outputs.branch_id }}
          api_key: ${{ secrets.NEON_API_KEY }}
Screenshot_2024-09-03_at_5.17.33_PM.png
Was this page helpful?