weighted-approval.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. name: weighted-approval
  2. on:
  3. pull_request_target:
  4. types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
  5. workflow_run:
  6. workflows: [weighted-approval-review-event]
  7. types: [completed]
  8. permissions:
  9. contents: read
  10. pull-requests: read
  11. statuses: write
  12. concurrency:
  13. group: weighted-approval-${{ github.event.pull_request.number || github.event.workflow_run.head_sha }}
  14. cancel-in-progress: false
  15. jobs:
  16. publish-status:
  17. if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
  18. name: weighted approval publisher
  19. runs-on: ubuntu-latest
  20. timeout-minutes: 5
  21. steps:
  22. # SECURITY: the status-writing job executes policy from the trusted default
  23. # branch and reads pull-request reviews only as API data.
  24. - name: Check out trusted approval policy
  25. uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
  26. with:
  27. ref: ${{ github.event.repository.default_branch }}
  28. persist-credentials: false
  29. - name: Publish weighted approval status
  30. env:
  31. GITHUB_TOKEN: ${{ github.token }}
  32. GITHUB_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  33. run: node .github/review-ownership/check-approval.mjs