Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit bc586dd

Browse files
authored
chore: fix SHA passed to e2e-tests workflow (#699)
* chore: fix SHA passed to e2e-tests workflow * update SHA to be PR sha if available * update checkout ref * fix syntax error
1 parent 27526e7 commit bc586dd

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,6 @@ jobs:
6060
token: ${{ secrets.BOT_GITHUB_TOKEN }}
6161
ref: ${{ github.event.pull_request.head.ref || github.ref }}
6262
# FIXME: Passing sha doesn't seem to work, created GitHub ticket here: https://github.community/t/workflow-dispatch-cant-set-ref-to-commit-sha/138132
63-
# But using ref (branch name) should be fine as it means tests always run on latest commit on PR or master branch
63+
# So for now we pass in SHA as an input
6464
# ref: ${{ github.event.pull_request.head.sha || github.sha }}
65+
inputs: '{"sha": "${{ github.event.pull_request.head.sha || github.sha }}"}'

.github/workflows/e2e-tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: "Pull Request ID"
88
required: false
99
default: ""
10+
sha:
11+
description: "GitHub SHA"
12+
required: false
13+
default: ""
1014

1115
jobs:
1216
initialize:
@@ -43,7 +47,7 @@ jobs:
4347
context: "End-to-end Tests"
4448
description: "Waiting for end-to-end tests to pass"
4549
state: "pending"
46-
sha: ${{ steps.set_pr_git_sha.outputs.pr_git_sha || github.sha }}
50+
sha: ${{ steps.set_pr_git_sha.outputs.pr_git_sha || github.event.inputs.sha || github.sha }}
4751
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
4852

4953
run-e2e-tests:
@@ -64,6 +68,8 @@ jobs:
6468
# For non-fork PRs
6569
- uses: actions/checkout@v2
6670
if: ${{ github.event.inputs.pull_request_id == '' }}
71+
with:
72+
ref: ${{ github.event.inputs.sha || github.ref }}
6773

6874
# For manually run PRs
6975
- name: Initialize empty git repository
@@ -116,7 +122,7 @@ jobs:
116122
context: "End-to-end Tests"
117123
description: "End-to-end tests have failed"
118124
state: "failure"
119-
sha: ${{ needs.initialize.outputs.pr_git_sha || github.sha }}
125+
sha: ${{ needs.initialize.outputs.pr_git_sha || github.event.inputs.sha || github.sha }}
120126
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
121127

122128
finalize:
@@ -133,5 +139,5 @@ jobs:
133139
context: "End-to-end Tests"
134140
description: "End-to-end tests have passed"
135141
state: "success"
136-
sha: ${{ needs.initialize.outputs.pr_git_sha || github.sha }}
142+
sha: ${{ needs.initialize.outputs.pr_git_sha || github.event.inputs.sha || github.sha }}
137143
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

0 commit comments

Comments
 (0)