Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action throws an authorization error #24

Open
nishad-playground opened this issue Jan 7, 2025 · 9 comments
Open

Action throws an authorization error #24

nishad-playground opened this issue Jan 7, 2025 · 9 comments
Assignees

Comments

@nishad-playground
Copy link

Steps to reproduce

Using action as described in Readme

name: Delete Neon Branch with GitHub Actions Demo
run-name: Delete a Neon Branch 🚀
on: [push]
jobs:
  delete-neon-branch:
    steps:
      uses: neondatabase/delete-branch-action@v3
      with:
        project_id: rapid-haze-373089
        branch: br-long-forest-224191
        api_key: ${{ secrets.NEON_API_KEY }}

Expected result

Deleting branch without producing an error

Actual result

ERROR: The request could not be authorized due to an internal error

Environment

Linux X64 github-hosted

Logs, links

Image
  • It narrow downs to the issue with using v2 when installing neonctl npm i -g neonctl@v2. If I changed it to latest, it works fine
npm i -g neonctl@latest
@luist18
Copy link

luist18 commented Jan 8, 2025

Hi @nishad-playground, do you mind sharing the project id?

@rumyantseva rumyantseva self-assigned this Jan 8, 2025
@nishad-playground
Copy link
Author

Hi @nishad-playground, do you mind sharing the project id?

hello @luist18 this is the project id I used: flat-art-32703613

@asterikx
Copy link

@luist18 I'm also experiencing the exact same error. Is there already a solution?

@nishad-playground
Copy link
Author

@luist18 I'm also experiencing the exact same error. Is there already a solution?

I was able to resolve it by making sure that the action step does have access to api key env.

@asterikx
Copy link

@nishad-playground thank you! Unfortunately, it doesn't solve the issue in my case. I could confirm that the API key is properly provided by echoing it before the neondatabase/delete-branch-action. My project ID is plain-brook-93209156.

@nishad-playground
Copy link
Author

@nishad-playground thank you! Unfortunately, it doesn't solve the issue in my case. I could confirm that the API key is properly provided by echoing it before the neondatabase/delete-branch-action. My project ID is plain-brook-93209156.

Okay alternatively what I did is forked the repo and used npm i -g neonctl@latest instead of npm i -g neonctl@v2

@asterikx
Copy link

Thanks! I ended up directly using neonctl in my workflow. Works just fine!

name: Clean-up PR

on:
  pull_request:
    types: [closed]

jobs:
  delete-pr:
    environment: preview
    runs-on: ubuntu-latest
    steps:
      - uses: oven-sh/setup-bun@v2

      - name: Delete Neon Branch
        run: bunx neonctl branches delete preview/pr-${{ github.event.number }}-${{ github.event.pull_request.head.ref }} --project-id ${{ vars.NEON_PROJECT_ID }}
        env:
          NEON_API_KEY: ${{ secrets.NEON_API_KEY }}

@luist18
Copy link

luist18 commented Jan 21, 2025

hello @luist18 this is the project id I used: flat-art-32703613

@nishad-playground are you sure that is the correct project_id? I can't find any GitHub integration connected with that project or logs for the specific error you provided

@luist18
Copy link

luist18 commented Jan 21, 2025

Can you verify if you have both NEON_API_KEY and NEON_PROJECT_ID set in your GitHub repository settings? @nishad-playground

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants