Skip to content

Commit 95b5f90

Browse files
dx: compact playwright PR comment header with 🎭 prefix
Amp-Thread-ID: https://ampcode.com/threads/T-019c832c-2fc7-73e9-b8c4-d201dc36511b
1 parent 5be6a1f commit 95b5f90

File tree

3 files changed

+6
-32
lines changed

3 files changed

+6
-32
lines changed

.github/workflows/ci-tests-e2e-forks.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
workflows: ['CI: Tests E2E']
77
types: [requested, completed]
88

9-
env:
10-
DATE_FORMAT: '+%m/%d/%Y, %I:%M:%S %p'
11-
129
jobs:
1310
deploy-and-comment-forked-pr:
1411
runs-on: ubuntu-latest
@@ -63,8 +60,7 @@ jobs:
6360
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
6461
"${{ steps.pr.outputs.result }}" \
6562
"${{ github.event.workflow_run.head_branch }}" \
66-
"starting" \
67-
"$(date -u '${{ env.DATE_FORMAT }}')"
63+
"starting"
6864
6965
- name: Download and Deploy Reports
7066
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'

.github/workflows/ci-tests-e2e.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@ jobs:
182182
- name: Checkout repository
183183
uses: actions/checkout@v6
184184

185-
- name: Get start time
186-
id: start-time
187-
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
188-
189185
- name: Post starting comment
190186
env:
191187
GITHUB_TOKEN: ${{ github.token }}
@@ -194,8 +190,7 @@ jobs:
194190
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
195191
"${{ github.event.pull_request.number }}" \
196192
"${{ github.head_ref }}" \
197-
"starting" \
198-
"${{ steps.start-time.outputs.time }}"
193+
"starting"
199194
200195
# Deploy and comment for non-forked PRs only
201196
deploy-and-comment:

scripts/cicd/pr-playwright-deploy-and-comment.sh

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
# Deploy Playwright test reports to Cloudflare Pages and comment on PR
5-
# Usage: ./pr-playwright-deploy-and-comment.sh <pr_number> <branch_name> <status> [start_time]
5+
# Usage: ./pr-playwright-deploy-and-comment.sh <pr_number> <branch_name> <status>
66

77
# Input validation
88
# Validate PR number is numeric
@@ -31,8 +31,6 @@ case "$STATUS" in
3131
;;
3232
esac
3333

34-
START_TIME="${4:-$(date -u '+%m/%d/%Y, %I:%M:%S %p')}"
35-
3634
# Required environment variables
3735
: "${GITHUB_TOKEN:?GITHUB_TOKEN is required}"
3836
: "${GITHUB_REPOSITORY:?GITHUB_REPOSITORY is required}"
@@ -135,23 +133,8 @@ post_comment() {
135133
# Main execution
136134
if [ "$STATUS" = "starting" ]; then
137135
# Post concise starting comment
138-
comment=$(cat <<EOF
139-
$COMMENT_MARKER
140-
## 🎭 Playwright Tests: ⏳ Running...
141-
142-
Tests started at $START_TIME UTC
143-
144-
<details>
145-
<summary>📊 Browser Tests</summary>
146-
147-
- **chromium**: Running...
148-
- **chromium-0.5x**: Running...
149-
- **chromium-2x**: Running...
150-
- **mobile-chrome**: Running...
151-
152-
</details>
153-
EOF
154-
)
136+
comment="$COMMENT_MARKER
137+
## 🎭 Playwright: ⏳ Running..."
155138
post_comment "$comment"
156139

157140
else
@@ -300,7 +283,7 @@ else
300283

301284
# Generate compact single-line comment
302285
comment="$COMMENT_MARKER
303-
**Playwright:** $status_icon $total_passed passed, $total_failed failed$flaky_note"
286+
## 🎭 Playwright: $status_icon $total_passed passed, $total_failed failed$flaky_note"
304287

305288
# Extract and display failed tests from all browsers (flaky tests are treated as passing)
306289
if [ $total_failed -gt 0 ]; then

0 commit comments

Comments
 (0)