Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#361 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
github-actions, typescript

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
TypeScript
星标
268
派生
113
平均合并
13 分钟
30 天内合并 PR
5

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

jfrog/setup-jfrog-cli 的其他 Issue

查看 jfrog/setup-jfrog-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。