Skip to content

Commit 298f5a7

Browse files
chore: use branch test results for e2e page (#517)
* added input * add if to stop deplot if not run ID * changes input type to boolean * remove string * revert --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 4d681e1 commit 298f5a7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: .github/workflows/e2e-report.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: 'Deploy e2e test page'
22
on:
33
workflow_dispatch:
4+
inputs:
5+
use-branch:
6+
description: 'Enable if you want to test data from your selected branch instead of the scheduled test runs from Main'
7+
type: boolean
48

59
env:
610
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
@@ -15,9 +19,14 @@ jobs:
1519
- name: Get run id
1620
id: get-run-id
1721
run: |
18-
E2E_RUN_ID=$(gh run list -w test-e2e.yml -e schedule --json databaseId --jq ".[0].databaseId" --repo $GITHUB_REPOSITORY)
22+
if [ "${{ inputs.use-branch }}" == "true" ]; then
23+
E2E_RUN_ID=$(gh run list -w test-e2e.yml -e workflow_dispatch -b $GITHUB_REF_NAME --json databaseId --jq ".[0].databaseId" --repo $GITHUB_REPOSITORY)
24+
else
25+
E2E_RUN_ID=$(gh run list -w test-e2e.yml -e schedule --json databaseId --jq ".[0].databaseId" --repo $GITHUB_REPOSITORY)
26+
fi
1927
echo "runId=$E2E_RUN_ID" >> $GITHUB_OUTPUT
2028
- name: Download latest e2e results
29+
if: ${{ steps.get-run-id.outputs.runId }}
2130
run: |
2231
echo "Downloading latest test results from run https://github.com/netlify/next-runtime-minimal/actions/runs/${{ steps.get-run-id.outputs.runId }}"
2332
rm e2e-report/data/test-results.json

0 commit comments

Comments
 (0)