Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
devops: migrate automations to GitHub App (#35273)
Max Schmitt23c4c256b037
diff --git a/.github/workflows/cherry_pick_into_release_branch.yml b/.github/workflows/cherry_pick_into_release_branch.ymlindex 08c5562f35..777a12683e 100644--- a/.github/workflows/cherry_pick_into_release_branch.yml+++ b/.github/workflows/cherry_pick_into_release_branch.yml@@ -59,10 +59,15 @@ jobs:echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUTgit checkout -b "$BRANCH_NAME"git push origin $BRANCH_NAME+ - uses: actions/create-github-app-token@v1+ id: app-token+ with:+ app-id: ${{ vars.PLAYWRIGHT_APP_ID }}+ private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}- name: Create Pull Requestuses: actions/github-script@v7with:- github-token: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}+ github-token: ${{ steps.app-token.outputs.token }}script: |const readableCommitHashesList = '${{ github.event.inputs.commit_hashes }}'.split(',').map(hash => `- ${hash}`).join('\n');const response = await github.rest.pulls.create({diff --git a/.github/workflows/pr_check_client_side_changes.yml b/.github/workflows/pr_check_client_side_changes.ymlindex 003831dffc..449c2a5d20 100644--- a/.github/workflows/pr_check_client_side_changes.yml+++ b/.github/workflows/pr_check_client_side_changes.yml@@ -16,10 +16,20 @@ jobs:if: github.repository == 'microsoft/playwright'steps:- uses: actions/checkout@v4+ - uses: actions/create-github-app-token@v1+ id: app-token+ with:+ app-id: ${{ vars.PLAYWRIGHT_APP_ID }}+ private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}+ repositories: |+ playwright+ playwright-python+ playwright-java+ playwright-dotnet- name: Create GitHub issueuses: actions/github-script@v7with:- github-token: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}+ github-token: ${{ steps.app-token.outputs.token }}script: |const currentPlaywrightVersion = require('./package.json').version.match(/\d+\.\d+/)[0];const { data } = await github.rest.git.getCommit({@@ -61,4 +71,4 @@ jobs:issue_number: issueNumber,body: newBody})- }\ No newline at end of file+ }diff --git a/.github/workflows/publish_canary.yml b/.github/workflows/publish_canary.ymlindex 78fb0ba5a9..5d0d1bd139 100644--- a/.github/workflows/publish_canary.yml+++ b/.github/workflows/publish_canary.yml@@ -72,13 +72,19 @@ jobs:- uses: actions/setup-node@v4with:node-version: 18+ - uses: actions/create-github-app-token@v1+ id: app-token+ with:+ app-id: ${{ vars.PLAYWRIGHT_APP_ID }}+ private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}+ repositories: playwright.dev- name: Deploy Canaryrun: bash utils/build/deploy-trace-viewer.sh --canaryif: contains(github.ref, 'main')env:- GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}+ GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }}- name: Deploy BETArun: bash utils/build/deploy-trace-viewer.sh --betaif: contains(github.ref, 'release')env:- GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}+ GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }}diff --git a/.github/workflows/publish_release_traceviewer.yml b/.github/workflows/publish_release_traceviewer.ymlindex e61ac76ccd..9c7ab06aa2 100644--- a/.github/workflows/publish_release_traceviewer.yml+++ b/.github/workflows/publish_release_traceviewer.yml@@ -14,7 +14,13 @@ jobs:- uses: actions/setup-node@v4with:node-version: 18+ - uses: actions/create-github-app-token@v1+ id: app-token+ with:+ app-id: ${{ vars.PLAYWRIGHT_APP_ID }}+ private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}+ repositories: playwright.dev- name: Deploy Stablerun: bash utils/build/deploy-trace-viewer.sh --stableenv:- GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}+ GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }}diff --git a/.github/workflows/roll_browser_into_playwright.yml b/.github/workflows/roll_browser_into_playwright.ymlindex 88fae9c031..b0a6461e73 100644--- a/.github/workflows/roll_browser_into_playwright.yml+++ b/.github/workflows/roll_browser_into_playwright.yml@@ -49,10 +49,15 @@ jobs:git add .git commit -m "feat(${BROWSER}): roll to r${REVISION}"git push origin $BRANCH_NAME --force+ - uses: actions/create-github-app-token@v1+ id: app-token+ with:+ app-id: ${{ vars.PLAYWRIGHT_APP_ID }}+ private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}- name: Create Pull Requestuses: actions/github-script@v7with:- github-token: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}+ github-token: ${{ steps.app-token.outputs.token }}script: |const response = await github.rest.pulls.create({owner: 'microsoft',diff --git a/.github/workflows/roll_driver_nodejs.yml b/.github/workflows/roll_driver_nodejs.ymlindex ee0d3d262c..e9b7cec904 100644--- a/.github/workflows/roll_driver_nodejs.yml+++ b/.github/workflows/roll_driver_nodejs.yml@@ -33,11 +33,16 @@ jobs:git add .git commit -m "chore(driver): roll driver to recent Node.js LTS version"git push origin $BRANCH_NAME+ - uses: actions/create-github-app-token@v1+ id: app-token+ with:+ app-id: ${{ vars.PLAYWRIGHT_APP_ID }}+ private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}- name: Create Pull Requestif: ${{ steps.prepare-branch.outputs.HAS_CHANGES == '1' }}uses: actions/github-script@v7with:- github-token: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}+ github-token: ${{ steps.app-token.outputs.token }}script: |await github.rest.pulls.create({owner: 'microsoft',diff --git a/.github/workflows/trigger_tests.yml b/.github/workflows/trigger_tests.ymlindex 1ea2ec424d..033c254ef3 100644--- a/.github/workflows/trigger_tests.yml+++ b/.github/workflows/trigger_tests.yml@@ -11,6 +11,12 @@ jobs:name: "trigger"runs-on: ubuntu-24.04steps:+ - uses: actions/create-github-app-token@v1+ id: app-token+ with:+ app-id: ${{ vars.PLAYWRIGHT_APP_ID }}+ private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}+ repositories: playwright-browsers- run: |curl -X POST \-H "Accept: application/vnd.github.v3+json" \@@ -18,4 +24,4 @@ jobs:--data "{\"event_type\": \"playwright_tests\", \"client_payload\": {\"ref\": \"${GITHUB_SHA}\"}}" \https://api.github.com/repos/microsoft/playwright-browsers/dispatchesenv:- GH_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}+ GH_TOKEN: ${{ steps.app-token.outputs.token }}