codeql-action/init workflow validation doesn't respect custom source-root

未關閉
#3,142 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
github-actions, typescript
領域
ci-cd, security

研究方向

從 src/workflow.ts 第 285-290 行開始,issue 將其確定為警告的可能來源。使用路徑 "my-custom-path" 的 actions/checkout,以及使用 source-root "my-custom-path" 的 init,重現此驗證流程。在沒有報告的警告的情況下找到自訂 CodeQL workflow 即表示完成。

由索引模型根據 Issue 內容生成。

描述

We get the warning

Warning: Unable to validate code scanning workflow: error: getWorkflow() failed: Error: Expected to find a code scanning workflow file at /home/runner/_work/ProDriver-Safety-Path/ProDriver-Safety-Path/.github/workflows/nightly_codeql.yml, but no such file existed. This can happen if the currently running workflow checks out a branch that doesn't contain the corresponding workflow file.

in our custom CodeQL workflow. We check out our repository in a custom location and specify this location using source-root:

  - name: Checkout
    uses: actions/checkout@v4
    if: always()
    with:
        path: "my-custom-path"

  - name: Initialize CodeQL
    uses: github/codeql-action/init@v3
    with:
        languages: ${{ matrix.language }}
        build-mode: ${{ matrix.build-mode }}
        source-root: "my-custom-path"

It looks like the bug is this code: https://github.com/github/codeql-action/blob/c6e30a2b5a6e3c0a72eb142ec994f99816593c51/src/workflow.ts#L285-L290

主要語言
TypeScript
星號
1.6k
分支
493
平均合併
1 天 13 小時
30 天內合併 PR
44

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/codeql-action 的其他 Issue

查看 github/codeql-action 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。