简体   繁体   中英

How to leave the github actions run result in the PR comments

I want to leave the result of "run audit" as a PR comment, but I don't know how. I'd appreciate your help.

      - name: Run audit
        run: yarn audit

You can use one of the existing GitHub actions from Marketplace.

One solution will be:

- 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 }}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM