NeonN
Neon9mo ago
1 reply
endless-jade

Neon Database Branch Deletion Issue in GitHub Actions

I'm facing a permission issue with Neon Database branch deletion in my GitHub Actions workflow. The API key works for listing projects but fails when trying to delete branches.

The Error

ERROR: user has no access to projects
Error: Process completed with exit code 1.


My Workflow


- name: Delete Neon Branch
  uses: neondatabase/delete-branch-action@v3.1.3
  with:
    project_id: ${{ secrets.NEON_PROJECT_ID }}
    branch: preview/pr-8-preview
    api_key: ${{ secrets.NEON_API_KEY }}


Debugging Steps
I can successfully list projects:


- name: Verify API Access
  run: neonctl projects list
  env:
    NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
`


Output shows I can see all projects:


Projects
┌───────────────────────────┬───────────────────┬──────────────────┬──────────────────────┐
│ Id                        │ Name              │ Region Id        │ Created At           │
├───────────────────────────┼───────────────────┼──────────────────┼──────────────────────┤
│ ***       │ growtools         │ aws-eu-central-1 │ 2025-04-09T09:27:21Z │
├───────────────────────────┼───────────────────┼──────────────────┼──────────────────────┤
│ empty-forest-81403208     │ turbo-boilerplate │ aws-eu-central-1 │ 2025-03-26T17:34:26Z │
...
`


Interestingly, the ID for my growtools project is redacted (***) while other project IDs are visible, suggesting the API key might have different permission levels for different projects.
I've tried creating new API keys with admin permissions but still get the same error. Any ideas on how to properly configure an API key with branch deletion permissions specifically for this project?
Was this page helpful?