0

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
smooth97
  • 73
  • 2
  • 9

1 Answers1

0

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 }}
Grzegorz Krukowski
  • 18,081
  • 5
  • 50
  • 71