Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: gate PR CI triage on write access (#42215)

Simon Knottbcb3563aa73d
diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml
index e47c993396..2716035797 100644
--- a/.github/workflows/create_test_report.yml
+++ b/.github/workflows/create_test_report.yml
@@ -74,11 +74,18 @@ jobs:
echo "number=$NUMBER" >> "$GITHUB_OUTPUT"
AUTHOR=$(gh pr view --repo "${{ github.repository }}" "$HEAD_REF" --json author --jq '.author.login' 2>/dev/null || true)
- ALLOWED="github-actions[bot] pavelfeldman yury-s dgozman Skn0tt dcrousso"
TRIAGE_ALLOWED=false
- for a in $ALLOWED; do
- if [ "$a" = "$AUTHOR" ]; then TRIAGE_ALLOWED=true; break; fi
- done
+ case "$AUTHOR" in
+ app/github-actions|app/microsoft-playwright-automation)
+ TRIAGE_ALLOWED=true
+ ;;
+ *)
+ if [ -n "$AUTHOR" ]; then
+ PERM=$(gh api "repos/${{ github.repository }}/collaborators/$AUTHOR/permission" --jq .permission 2>/dev/null || echo none)
+ case "$PERM" in write|admin) TRIAGE_ALLOWED=true ;; esac
+ fi
+ ;;
+ esac
echo "triage_allowed=$TRIAGE_ALLOWED" >> "$GITHUB_OUTPUT"
- name: Post report comment to PR