Question

github action ... doctl apps update fails with GitHub user not authenticated

Hello!

I have actions working with doctl.

    jobs:
    
      deploy:
        name: Development App Stack
        runs-on: ubuntu-latest
        timeout-minutes: 10
        steps:
    
          - name: install-doctl
            uses: digitalocean/action-doctl@v2
            with:
              token: ${{ secrets.DO_TOKEN }}
       
          - name: get-app
             run: doctl apps get <DO app id>
    
          - name: update-app
             run: doctl apps update <DO app id> --spec "<yaml file in github repo>" --access-token ${{ secrets.DO_TOKEN }}

Problem:

  • install-doctl WORKS
  • get-app WORKS
  • update-app FAILS

Error:

Error: PUT https://api.digitalocean.com/v2/apps/<DO app id>: 400 (request "aaaa...") 
**GitHub user not authenticated**

I am fairly sure this is the REST API refusing even though I am passing the same token I used to get-app.

What is the REST API expecting?

Thanks!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
October 17, 2023

Hi there,

As you are able to run the doctl apps get <DO app id> command but not the update command, I could suggest making sure that your DigitalOcean API token has both read and write access.

If this is already the case, when using the same token, are you able to run the doctl apps update <DO app id> --spec "<yaml-file>" --access-token ${{ secrets.DO_TOKEN }} command locally and does it complete successfully when executed locally?

The error that you are seeing could also be due to the lack of permissions to the GitHub repository itself, you need to make sure that the DigitalOcean App Platform has the necessary permissions to access your GitHub repository. This usually requires connecting your GitHub account to DigitalOcean and granting repository access. If you’ve made changes to the permissions or revoked access, you might encounter such errors.

Let me know how it goes!

Best,

Bobby

Never mind … figured it out. This was caused by not having digitalocean installed in my github account.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more