Skip to content

Commit 0e19b1c

Browse files
authored
fix: Updates playwright conditional (#637)
Gemini sayeth: Unified Set BASE_REF Step: The "Set BASE_REF for PRs" step has been renamed to the more general "Set BASE_REF". The if condition is now inside the run block, using a shell if statement to determine the correct base_ref value based on github.event_name. This makes the logic clearer and handles both pull_request and other events (like push) consistently. Consistent find-changes.sh Call: The "Get Affected Workspaces" step now always calls find-changes.sh with a BASE_REF argument: bash samples/find-changes.sh ${{ steps.set_base_ref.outputs.base_ref }}. This argument will always be populated thanks to the Set BASE_REF step.
1 parent a9f1b9a commit 0e19b1c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/playwright.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,20 @@ jobs:
5050
fetch-depth: 0
5151
lfs: true
5252

53-
- name: Set BASE_REF for PRs
53+
- name: Set BASE_REF
5454
id: set_base_ref
55-
if: github.event_name == 'pull_request'
56-
run: echo "base_ref=origin/${{ github.base_ref }}" >> $GITHUB_OUTPUT
55+
run: |
56+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
57+
echo "base_ref=origin/${{ github.base_ref }}" >> $GITHUB_OUTPUT
58+
else
59+
echo "base_ref=${{ github.event.before }}" >> $GITHUB_OUTPUT
60+
fi
5761
5862
- name: Get Affected Workspaces
5963
id: get_workspaces
6064
# For PRs, compare against the origin's version of the base branch.
6165
# For pushes, compare against the commit before the push.
62-
run: bash samples/find-changes.sh ${{ steps.set_base_ref.outputs.base_ref || github.event.before }}
66+
run: bash samples/find-changes.sh ${{ steps.set_base_ref.outputs.base_ref }}
6367

6468
- name: Setup Node.js
6569
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)