Skip to content

Commit e44b566

Browse files
committed
build(ci): don't store screenshots on most PRs
Store only needs to be executed on `main` We run on some file changes, in case they break the upload process, but this is only defensive. Note: this does upload artifacts, this could be avoided, but the complexity makes the 'happy path' of this workflow harder to reason about. Issue 20942 Assisted-by: Claude Opus 4.7
1 parent 284c638 commit e44b566

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/screenshot_store.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,22 @@ on:
2626
push:
2727
branches:
2828
- main
29+
# On PRs, only run this when structural changes occur, to be sure 'main' can still store baselines
2930
pull_request:
31+
paths:
32+
- '.github/workflows/screenshot_*.yml'
33+
- 'gradle/libs.versions.toml'
34+
- 'AnkiDroid/build.gradle'
35+
- 'AnkiDroid/build.gradle.kts' # future-proof
36+
- '**/ScreenshotTest.kt'
37+
- 'tools/compare-screenshot-test.sh'
3038

3139
permissions: {}
3240

3341
jobs:
3442
store-screenshot-test:
35-
name: store
43+
# On PRs, this verifies the workflow runs on `main`, it's not a store
44+
name: ${{ github.ref == 'refs/heads/main' && 'store' || 'test' }}
3645
runs-on: ubuntu-latest
3746
timeout-minutes: 20
3847

0 commit comments

Comments
 (0)