Coder Social home page Coder Social logo

Comments (5)

mozisan avatar mozisan commented on August 25, 2024 1

This works for me.

- uses: google-github-actions/auth@v2
  with:
    project_id: ...
    workload_identity_provider: ...
- run: gcloud auth configure-docker ${{ secrets.MY_REGISTRY }}

from login-action.

cbini avatar cbini commented on August 25, 2024 1

Closing, as I no longer use this action after this resolution. Not sure if there's a way to integrate using the gcloud credHelper into the action, but maybe it could be helpful in the future.

from login-action.

bjornherder avatar bjornherder commented on August 25, 2024

It is possible by adding the argument token_format: "access_token" to the google-github-actions/auth@v2 action. Here is a link to the docs.

The access token can then be supplied through the password argument, i.e. password: "${{ steps.auth.outputs.access_token }}"

from login-action.

cbini avatar cbini commented on August 25, 2024

This works for me.

- uses: google-github-actions/auth@v2
  with:
    project_id: ...
    workload_identity_provider: ...
- run: gcloud auth configure-docker ${{ secrets.MY_REGISTRY }}

Thanks for this! Figured I could use the Docker login action, but I'll give this a try.

from login-action.

cbini avatar cbini commented on August 25, 2024

@mozisan do you have a full workflow example you could share? I'm trying gcloud auth configure-docker, but the docker/build-push-action is still failing with:

ERROR: failed to push us-central1-docker.pkg.dev/.../.../...: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://us-central1-docker.pkg.dev/v2/token?scope=repository%3A...%2F...%2F...%3Apull%2Cpush&service=us-central1-docker.pkg.dev: 403 Forbidden

(my repo-specific info removed)

EDIT: my issue was Step 5 -- the workload identity pool principalSet needed the IAM binding with artifact registry permissions

from login-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.