Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/prevent-publicapi-addition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Prevent PublicAPI File Additions

on: [pull_request]

jobs:
check-publicapi-files:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Scan for accidental PublicAPI references
run: |
set -e # Stop on first error

# Find all .csproj files and check for unwanted lines
if find . -name "*.csproj" -exec grep -q "PublicAPI.Shipped.txt" {} \; || \
find . -name "*.csproj" -exec grep -q "PublicAPI.Unshipped.txt" {} \;
then
echo "Error: PublicAPI.Shipped.txt or PublicAPI.Unshipped.txt detected in a .csproj file."
exit 1
fi

echo "All good - No PublicAPI references found."
Loading