Skip to content

Commit

Permalink
feat: Comment after running script
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Apr 29, 2024
1 parent 16c89ef commit 527ce14
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/periphery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Periphery
id: periphery
run: ./scripts/periphery.sh
- uses: mshick/add-pr-comment@v2
with:
message: |
Found ${{ steps.periphery.outputs.unused_count }} unused code occurences
<details>
<summary>Expand</summary>
```
${{ steps.periphery.outputs.detailed_output }}
```
</details>
7 changes: 7 additions & 0 deletions scripts/periphery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ unusedCount=$(wc -l <<< "$detailedOutput" | tr -d '[:space:]')

echo "$detailedOutput"
echo "Total unused instances $unusedCount"

# Output script result to GITHUB_OUTPUT to get it in next step
echo 'detailed_output<<EOF' >> $GITHUB_OUTPUT
echo "$detailedOutput" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT

echo "unused_count=$unusedCount" >> $GITHUB_OUTPUT

0 comments on commit 527ce14

Please sign in to comment.