共用方式為


AdvancedSecurity-Publish@1 - Advanced Security 發佈結果 v1 任務

結合程式代碼掃描工具所產生的 SARIF 檔案、增強合併的 SARIF 檔案,並將增強的 SARIF 檔案發佈至進階安全性服務。

備註

此任務將非 Microsoft 任務生成的 SARIF 檔發布到 Code scanning for GitHub Advanced Security。 目前,此任務適用於 Infrastructure-as-Code Scanning 任務擴展 任務。 有關更多資訊,請參閱 基礎設施即代碼掃描

GitHub Advanced Security 用於 Azure DevOps 任務(如 AdvancedSecurity-Dependency-Scanning@1AdvancedSecurity-Codeql-Analyze@1)時,不需要此任務。

語法

# Advanced Security Publish Results v1
# Combines SARIF file(s) produced by code scanning tool(s), enhances the combined SARIF file, and publishes the enhanced SARIF file to the Advanced Security service.
- task: AdvancedSecurity-Publish@1
  inputs:
    #SarifsInputDirectory: # string. SARIF(s) Input Directory. 
    #Category: # string. Category. 
    #WaitForProcessing: false # boolean. Enable Wait for Processing. Default: false.
    #WaitForProcessingInterval: '5' # string. Optional. Use when WaitForProcessing = true. Wait for Processing Time Interval. Default: 5.
    #WaitForProcessingTimeout: '120' # string. Optional. Use when WaitForProcessing = true. Wait for Processing Timeout. Default: 120.

輸入

SarifsInputDirectory - SARIF(s) 輸入目錄
string

包含需要合併、增強和發佈到 Advanced Security 的 SARIF 文件的目錄的路徑。 如果未指定,則任務將在預先確定的位置查找 SARIF 檔。


Category - 類別
string

在發佈到 Advanced Security 之前增強 SARIF 檔時要與之關聯的類別。 掃描結果的類別有助於區分不同類型的掃描結果。 在發佈由 CodeQL 以外的工具生成的 SARIF 檔時,請使用此欄位。 發佈由 CodeQL 生成的 SARIF 檔時,無需指定類別,如果指定了類別,則任務將忽略該類別。


WaitForProcessing - 啟用 Wait for Processing
boolean。 預設值: false

請等待 Advanced Security 處理已發佈的 SARIF 檔,然後再完成。


WaitForProcessingInterval - 等待處理時間間隔
string。 選擇性。 WaitForProcessing = true時使用 。 預設值: 5

在每次調用 Advanced Security 以檢查 SARIF 處理狀態之間等待的時間(以秒為單位)。


WaitForProcessingTimeout - 等待處理超時
string。 選擇性。 WaitForProcessing = true時使用 。 預設值: 120

在完成之前等待 Advanced Security 處理 SARIF 文件的時間(以秒為單位)。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性

輸出變數

沒有。

備註

此任務將非 Microsoft 任務生成的 SARIF 檔發布到 Code scanning for GitHub Advanced Security。 目前,此任務適用於 Infrastructure-as-Code Scanning 任務擴展 任務。 有關更多資訊,請參閱 基礎設施即代碼掃描

GitHub Advanced Security 用於 Azure DevOps 任務(如 AdvancedSecurity-Dependency-Scanning@1AdvancedSecurity-Codeql-Analyze@1)時,不需要此任務。

需求

要求 說明
管線類型 YAML、傳統組建、傳統版本
執行於 Agent、DeploymentGroup
要求 沒有
能力 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 所有支援的代理程式版本。
工作類別 建造