簡體   English   中英

如何在 PR 評論中留下 github 操作運行結果

[英]How to leave the github actions run result in the PR comments

我想留下“運行審計”的結果作為 PR 評論,但我不知道如何。 我會很感激你的幫助。

      - name: Run audit
        run: yarn audit

您可以使用 Marketplace 中現有的 GitHub 操作之一。

一種解決方案是:

- name: Run audit
  id: audit
  run: |
     log="$(yarn audit)"
     echo "::set-output name=log::$log"
- name: Create or update comment
  uses: peter-evans/create-or-update-comment@v2
  with:
    issue-number: ${{ github.event.pull_request.number }}
    body: ${{ steps.audit.outputs.log }}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM