diff --git a/.github/workflows/pr-pii-check.yml b/.github/workflows/pr-pii-check.yml new file mode 100644 index 0000000..f038b65 --- /dev/null +++ b/.github/workflows/pr-pii-check.yml @@ -0,0 +1,48 @@ +name: PR PII Check + +on: + pull_request: + types: [opened, synchronize] + pull_request_review_comment: + types: [created, edited] + +permissions: + pull-requests: read + +jobs: + check-pii: + name: Check for PII in PR + runs-on: ubuntu-latest + if: >- + github.event_name == 'pull_request' || + github.event_name == 'pull_request_review_comment' + steps: + - name: Check PR description for PII + if: github.event_name == 'pull_request' + env: + PR_BODY: ${{ github.event.pull_request.body }} + run: | + echo "Checking PR description for PII patterns..." + printenv PR_BODY > /tmp/pr_body.txt + sed -i 's/\r$//' /tmp/pr_body.txt + # Strip system-appended footers before scanning + sed -i '/^Link to Devin session:/,$d' /tmp/pr_body.txt + sed -i '/^