Skip to content

Commit 89cd7ec

Browse files
committed
adds screenshot status with url, updates skill
1 parent 234d552 commit 89cd7ec

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/skills/update-screenshots/SKILL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@ Pick the most recent run that has a `screenshot-diff` artifact (runs where scree
3838
gh run download <run-id> --name screenshot-diff --dir .tmp/screenshot-diff
3939
```
4040

41-
This downloads:
42-
- `test/componentFixtures/.screenshots/current/` — the CI-captured screenshots
43-
- `test/componentFixtures/.screenshots/report.json` — structured diff report
44-
- `test/componentFixtures/.screenshots/report.md` — human-readable diff report
41+
The artifact is uploaded from two paths (`test/componentFixtures/.screenshots/current/` and `test/componentFixtures/.screenshots/report/`), but GitHub Actions strips the common prefix. So the downloaded structure is:
42+
- `current/` — the CI-captured screenshots (e.g. `current/baseUI/Buttons/Dark.png`)
43+
- `report/report.json` — structured diff report
44+
- `report/report.md` — human-readable diff report
4545

4646
### 3. Review the changes
4747

4848
Show the user what changed by reading the markdown report:
4949

5050
```bash
51-
cat .tmp/screenshot-diff/test/componentFixtures/.screenshots/report.md
51+
cat .tmp/screenshot-diff/report/report.md
5252
```
5353

5454
### 4. Copy CI screenshots to baseline
5555

5656
```bash
5757
# Remove old baselines and replace with CI screenshots
5858
rm -rf test/componentFixtures/.screenshots/baseline/
59-
cp -r .tmp/screenshot-diff/test/componentFixtures/.screenshots/current/ test/componentFixtures/.screenshots/baseline/
59+
cp -r .tmp/screenshot-diff/current/ test/componentFixtures/.screenshots/baseline/
6060
```
6161

6262
### 5. Clean up

.github/workflows/screenshot-test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212
contents: read
1313
pull-requests: write
1414
checks: write
15+
statuses: write
1516

1617
concurrency:
1718
group: screenshots-${{ github.event.pull_request.number || github.sha }}
@@ -110,6 +111,12 @@ jobs:
110111
EOF
111112
fi
112113
114+
DETAILS_URL="https://hediet-ghartifactpreview.azurewebsites.net/${{ github.repository }}/run/${{ github.run_id }}/component-explorer/___explorer.html?report=./screenshot-report/report.json"
115+
gh api "repos/${{ github.repository }}/statuses/$SHA" \
116+
--input - <<EOF
117+
{"state":"success","target_url":"$DETAILS_URL","description":"$TITLE","context":"screenshots / explorer"}
118+
EOF
119+
113120
- name: Post summary
114121
run: |
115122
if [ -f test/componentFixtures/.screenshots/report/report.md ]; then

0 commit comments

Comments
 (0)