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 091a578
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/periphery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Periphery
env:
URL: ${{ github.event.pull_request.comments_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/periphery.sh
6 changes: 6 additions & 0 deletions scripts/periphery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ unusedCount=$(wc -l <<< "$detailedOutput" | tr -d '[:space:]')

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

if [ -n "$GITHUB_TOKEN" ]; then
curl -X POST $URL -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" --data '{ "body": "'$detailedOutput'" }'
else
echo "No GitHub token"
fi

0 comments on commit 091a578

Please sign in to comment.