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

How to output token and pass to other action when using Direct WIF #470

Closed
mike-pt opened this issue Feb 11, 2025 · 3 comments
Closed

How to output token and pass to other action when using Direct WIF #470

mike-pt opened this issue Feb 11, 2025 · 3 comments

Comments

@mike-pt
Copy link

mike-pt commented Feb 11, 2025

Docs are a bit lacking into how to do this with Direct WIF but I bumped into to this sample from: docker/login-action#640 (comment)

      # Setup Google Cloud SDK
      - uses: 'google-github-actions/auth@v2'
        with:
          workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER }}'

      # Authenticate to Google Artifact Registry (GAR)
      - name: Docker Auth
        id: docker-auth
        uses: 'docker/login-action@v3'
        with:
          username: 'oauth2accesstoken'
          password: '${{ steps.auth.outputs.auth_token }}'
          registry: 'us-docker.pkg.dev'

I get no errors in the 1st setup but then login-action fails with , missing password, so I tried to debug the possible different outputs and all seems to be null:


steps.auth.outputs.access_token:
steps.auth.outputs.id_token:
steps.auth.outputs.auth_token:
steps.auth.outputs.credentials_file_path:

What am I missing?

Copy link

Hi there @mike-pt 👋!

Thank you for opening an issue. Our team will triage this as soon as we can. Please take a moment to review the troubleshooting steps which lists common error messages and their resolution steps.

@sethvargo
Copy link
Member

You haven't named your step. There is no step named "auth" in the example provided. You need to add id: '...' for outputs to work between steps: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/passing-information-between-jobs#example-defining-outputs-for-a-job

@sethvargo sethvargo closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2025
@mike-pt
Copy link
Author

mike-pt commented Feb 11, 2025

@sethvargo by now I should have earned that working late hours is never a good idea... See my brain was literally seeing "id" there, and I don't even have the excuse of not knowing its needed for outputs because how else would it work :D

oh well yeah that was the issue of course and it now works :)

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

No branches or pull requests

2 participants