Add eslint-plugin-playwright enforcement with secure CI workflow - #26515
Conversation
…h label gating Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>
|
@copilot address review comments |
Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>
Addressed both review comments in commit
|
Code Review ✅ Approved 2 resolved / 2 findingsAdds eslint-plugin-playwright enforcement with secure CI workflow, addressing TOCTOU vulnerability by using pull_request_target with label gating and removing redundant event_name condition. No open issues remain. ✅ 2 resolved✅ Security: TOCTOU:
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
Adds
eslint-plugin-playwrightto catch common Playwright anti-patterns and wires it into a secured CI workflow that runs on PRs touchingplaywright/files.ESLint Rule Configuration
Blocking (error) — fails CI immediately:
no-networkidlewaitForLoadState('networkidle')— unreliable with websockets/pollingno-page-pausepage.pause()— debug statements left in codeno-focused-testtest.only()/describe.only()— accidentally committed focusAspirational (warn) — tracks tech debt:
missing-playwright-await,no-wait-for-timeout,no-force-option,no-element-handle,no-eval,no-skipped-test,prefer-web-first-assertions,no-useless-await,no-wait-for-selector,valid-expectCurrent baseline: 0 errors, 1657 warnings.
CI Workflow Security (
ui-checkstyle.yml)Converted from
pull_request→pull_request_targetwith the standard repo security pattern:labeledevent: trigger types restricted to[labeled]only — prevents TOCTOU attacks where an attacker pushes malicious code after "safe to test" is applied (label persists across pushes); maintainer must re-apply the label after each new commitgithub.event.pull_request.head.shaonly after label verification passesactions/cachepoisoning vector — fork PRs can no longer inject malicious content into shared caches affecting base-branch runsif: ${{ github.event_name == 'pull_request_target' }}guards from label-gate steps sincepull_request_targetis the only triggerCleanup
networkidleusage inClassificationConditionalRendering.spec.tseslint-disablecomments referencing undefined rules (jest/no-export,react-hooks/rules-of-hooks)Type of change:
Checklist:
Fixes <issue-number>: <short explanation>📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.