actions-hub / gcloud

GitHub Action for interacting with Google Cloud Platform (GCP)
https://github.com/marketplace/actions/google-cloud-platform-gcp-cli-gcloud
MIT License
230 stars 27 forks source link

WARNING: You do not appear to have access to project [***] or it does not exist. #3

Closed ghost closed 5 years ago

ghost commented 5 years ago

Weirdly this command works:

gcloud config set project ${{GCLOUD_PROJECT}}

But when I set the actions it doesn't.

Using your exact example:

name: gcloud
on: [push]

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - uses: actions-hub/gcloud@master
        env:
          PROJECT_ID: myProject
          APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
        with:
          args: app deploy app.yaml
exelban commented 5 years ago

@bgold0 are you sure that provided project_id is correct?

gcloud config set project ${{GCLOUD_PROJECT}} - where this command works?

ghost commented 5 years ago

I apologize. This warning always shows and isn't reminiscent on whether you have the permissions to deploy or not. My problem was putting the flags before app deploy app.yaml and not afterwords so it wasn't actually doing anything.

So this issue doesn't get closed in vain. Here is a working example I used with flags:

- uses: actions-hub/gcloud@master
        env:
          PROJECT_ID: ${{secrets.GCLOUD_PROJECT}}
          APPLICATION_CREDENTIALS: ${{secrets.GCLOUD_API_KEYFILE}}
        with:
          args: app deploy app.yaml --no-promote --project ${{secrets.GCLOUD_PROJECT}} -v staging