diff --git a/.github/workflows/contributor-trust.yml b/.github/workflows/contributor-trust.yml new file mode 100644 index 0000000..d3b3df1 --- /dev/null +++ b/.github/workflows/contributor-trust.yml @@ -0,0 +1,40 @@ +name: Contributor Detection + +on: + issues: + types: [opened] + issue_comment: + types: [created] + pull_request_target: + types: [opened] + +permissions: + contents: read + issues: write + pull-requests: write + models: read + +concurrency: + group: contributor-detection-${{ github.event.pull_request.number || github.event.issue.number || github.run_id }}-${{ github.actor }} + cancel-in-progress: true + +jobs: + detection: + name: Detect automated contributors + if: github.actor != 'github-actions[bot]' + runs-on: ubuntu-latest + steps: + - name: Detect contributor automation + id: detection + uses: Open-Source-Bazaar/contributor-trust-action@main + with: + github-token: ${{ github.token }} + organization-token: ${{ secrets.PAT }} + block-high-confidence-automation: 'true' + + - name: Record detection result + env: + AUTHOR: ${{ steps.detection.outputs.author }} + RISK_LEVEL: ${{ steps.detection.outputs['risk-level'] }} + RISK_SCORE: ${{ steps.detection.outputs['risk-score'] }} + run: echo "@${AUTHOR} => ${RISK_LEVEL} (${RISK_SCORE}/100)"