配置取回要求狀態
啟用並配置取回要求的狀態檢查,以瞭解您的確定是否符合儲存庫中所設定的條件摘要。
取回要求中個別確定旁邊的三個 狀態 狀態如下:
- 擱置中
- passing
- 失敗
您可以使用 DevSecOps CLI set-status 指令來設定 GitHub 或 GitLab 確定狀態。
如需此指令的相關資訊,請參閱 DevSecCLI 文件。
- GitLab的範例:
$ export GITLAB_TOKEN='my-git-token'
$ export GHE_ORG='my-github-username'
$ export GHE_REPO='my-github-repo-name'
$ export GIT_COMMIT='1df4adf81a294315a3fb4e211df9ae6cad4895c1'
$ cocoa set-status \
--state="pending" \
--targetURL="https://cloud.ibm.com/devops/pipelines/tekton/pipeline-id/runs/run-id/lint/lint?env_id=ibm:yp:us-south" \
--context="tekton/lint" \
--description="Tekton linter is running." \
--git-provider="gitlab"
- GitHub的範例:
$ export GHE_TOKEN='my-git-token'
$ export GHE_ORG='my-github-username'
$ export GHE_REPO='my-github-repo-name'
$ export GIT_COMMIT='1df4adf81a294315a3fb4e211df9ae6cad4895c1'
$ cocoa set-status \
--state="pending" \
--targetURL="https://cloud.ibm.com/devops/pipelines/tekton/pipeline-id/runs/run-id/lint/lint?env_id=ibm:yp:us-south" \
--context="tekton/lint" \
--description="Tekton linter is running." \
--git-provider="github"