[upload-sarif@v3] action completely ignore the `sha` input and using commit hash from `checkout_path` instead

オープン
#2,807 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
github-actions, typescript
領域
ci-cd, security

調査の方向性

src/upload-sarif-action.ts の91行目と src/upload-lib.ts の605行目から始め、sha 入力と checkout_path の commit がどのように選択されるかを追跡します。YAML の例を使って報告された upload を再現し、リクエストボディを調べます。upload リクエストが指定された sha を commit_oid として使用すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

  • Usage:
uses: github/codeql-action/upload-sarif@v3
with:
  sarif_file: sarif-results/fix-paths-cpp.sarif
  ref: refs/heads/main
  sha: a8e616ed369f7f74173a13c5489dbae89c3b12
  checkout_path: /runner/_work/parent-repo/build
  • Output from action:
request: {
      method: 'PUT',
      url: 'https://github.com/api/v3/repos/PFO/OpenSIL/code-scanning/analysis',
      headers: {
        accept: 'application/vnd.github.v3+json',
        'user-agent': 'CodeQL-Action/3.22.12 octokit-core.js/3.6.0 Node.js/20.18.0 (linux; x64)',
        authorization: 'token [REDACTED]',
        'content-type': 'application/json; charset=utf-8'
      },
      body: '{"commit_oid":"b0b0efb3f489d6c16d35gsfd4b388173h99e1049","ref":"refs/heads/main","analysis_key":".github/workflows/codeql-nightly.yml:codeql","analysis_name":"CodeQL- Nightly","sarif":"..."}'

From the output, we can see that it is not actually uploading with the commit_oid that we assigned in the sha input.

Looking at the src code of the upload-sarif action:

主要言語
TypeScript
スター
1.6k
フォーク
493
平均マージ
1日 13時間
マージ済み PR(30日)
44

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/codeql-action のほかの issue

github/codeql-action の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。