Skip to content

Publish PostgreSQL Playwright PR Comment #999

Publish PostgreSQL Playwright PR Comment

Publish PostgreSQL Playwright PR Comment #999

# Copyright 2026 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Publish PostgreSQL Playwright PR Comment
on:
workflow_run:
workflows:
- Postgresql PR Playwright E2E Tests
types:
- completed
permissions:
actions: read
contents: read
pull-requests: write
concurrency:
group: playwright-postgresql-pr-comment-${{ github.event.workflow_run.head_repository.id }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false
jobs:
publish-playwright-comment:
if: >-
github.event.workflow_run.event == 'pull_request' ||
github.event.workflow_run.event == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout trusted workflow helpers
uses: actions/checkout@v7
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
- name: Download rendered Playwright comment
id: download-comment
continue-on-error: true
uses: actions/download-artifact@v7
with:
name: playwright-pr-comment-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}
path: ${{ runner.temp }}/playwright-pr-comment
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Playwright PR comment
if: ${{ always() && steps.download-comment.outcome == 'success' }}
uses: actions/github-script@v8
env:
COMMENT_PAYLOAD_PATH: ${{ runner.temp }}/playwright-pr-comment/summary.json
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const publishPlaywrightPrComment = require('./.github/scripts/publish_playwright_pr_comment.cjs');
await publishPlaywrightPrComment({ github, context, core });