Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

How do I use JFrog OIDC credentials to run a container in another job?

Đang mở
#361 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, typescript
Lĩnh vực
authentication, ci-cd

Hướng nghiên cứu

Start by reading src/oidc-utils.ts around the core.setSecret calls identified in the issue, and trace how the OIDC username and token become action outputs. Consider the interaction between secret masking and GitHub Actions job outputs before proposing a change. Done means the credentials can be passed to another job as described without compromising their handling.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Describe the bug

Currently, it's not possible to obtain OIDC credentials and then use them to run code on a different container

Mainly because {{ steps.jfrog.outputs.oidc-user }} and {{ steps.jfrog.outputs.oidc-password }} are marked as secrets using
https://github.com/jfrog/setup-jfrog-cli/blob/v5.3.0/src/oidc-utils.ts#L159

        core.setSecret(accessToken);
        core.setSecret(username);

by forking the repo and removing this lines, I was successfully able to do this:

name: Run a Container Hosted In Jfrog
run-name: Run a Container Hosted In Jfrog

permissions:
  contents: read
  id-token: write

on:
    workflow_dispatch:

jobs:
  jfrog_auth:
    name: "JFrog Authentication"
    runs-on: default
    outputs:
      jfrog_username: ${{ steps.jfrog.outputs.oidc-user }}
      jfrog_password: ${{ steps.jfrog.outputs.oidc-token }}

    steps:
      - name: Setup JFrog CLI (OIDC)
        id: jfrog
        uses: jfrog/setup-jfrog-cli@v5
        with:
          oidc-provider-name: MY_OIDC_PROVIDER_NAME
          oidc-audience: MY_OIDC_AUDIENCE
        env:
          JF_URL: https://MYORG.jfrog.io


  next_gen_web:
    runs-on: default
    needs: jfrog_auth
    container:
      image: MYORG.jfrog.io/MY_PATH/MY_CONTAINER:latest
      credentials:
        username: "${{ needs.jfrog_auth.outputs.jfrog_username }}"
        password: "${{ needs.jfrog_auth.outputs.jfrog_password }}"
    steps:
      - run: |
          echo "This is running from inside of MYORG.jfrog.io/MY_PATH/MY_CONTAINER:latest" 

Current behavior

oidc-user and oidc-password can not be transmitted between jobs

Reproduction steps

the code above

Expected behavior

the code above should work

Setup JFrog CLI version

jfrog/setup-jfrog-cli@v5

JFrog CLI version

none

Workflow operating system type and version

github actions

JFrog Artifactory version (if relevant)

No response

JFrog Xray version (if relevant)

No response

Ngôn ngữ chính
TypeScript
Star
267
Fork
111
Merge trung bình
10 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jfrog/setup-jfrog-cli

Tất cả issue của jfrog/setup-jfrog-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.