Skip to content

Commit 709e38f

Browse files
committed
Make it possible to test push_screenshots with dispatch
1 parent 470f255 commit 709e38f

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/push_screenshots.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
workflow_run:
55
workflows: ["Screenshot tests"]
66
types: [completed]
7+
workflow_dispatch:
8+
inputs:
9+
run-id:
10+
description: 'Run ID of a Screenshot tests workflow run to use as artifact source'
11+
required: true
712

813
permissions:
914
contents: read
@@ -13,15 +18,15 @@ jobs:
1318
push-screenshots:
1419
name: Push updated screenshots to ert-testdata
1520
runs-on: ubuntu-latest
16-
if: github.event.workflow_run.event == 'pull_request'
21+
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.event == 'pull_request'
1722

1823
steps:
1924
- name: Download screenshot artifact
2025
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
2126
with:
2227
name: screenshot-results
2328
path: artifact
24-
run-id: ${{ github.event.workflow_run.id }}
29+
run-id: ${{ inputs.run-id || github.event.workflow_run.id }}
2530
github-token: ${{ secrets.GITHUB_TOKEN }}
2631

2732
- name: Read metadata

.github/workflows/test_screenshots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
if: always()
5555
run: |
5656
mkdir -p artifact
57-
echo '{"pr_number": ${{ github.event.number }}, "outcome": "${{ steps.screenshot-tests.outcome }}"}' > artifact/metadata.json
57+
echo '{"pr_number": ${{ github.event.number || 0 }}, "outcome": "${{ steps.screenshot-tests.outcome }}"}' > artifact/metadata.json
5858
if [ -d updated-screenshots ]; then
5959
cp -r updated-screenshots artifact/
6060
fi

0 commit comments

Comments
 (0)