From 856971e6d622a0050a17564db5ec011c3b5b822d Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Tue, 27 Jan 2026 12:12:48 -0600 Subject: [PATCH 1/2] Pass latest commit ref to checkout --- .github/workflows/e2e-tests.yml | 7 +++++++ .github/workflows/test-e2e.yml | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 095592a..3036f59 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -8,6 +8,11 @@ on: # For test.yml to call this workflow workflow_call: + inputs: + ref: + description: "Git ref to checkout" + required: true + type: string secrets: OP_CONNECT_CREDENTIALS: required: true @@ -34,6 +39,7 @@ jobs: uses: actions/checkout@v5 with: fetch-depth: 0 + ref: ${{ inputs.ref }} - name: Generate .env.tpl shell: bash @@ -101,6 +107,7 @@ jobs: uses: actions/checkout@v5 with: fetch-depth: 0 + ref: ${{ inputs.ref }} - name: Generate .env.tpl run: | diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 9b2b360..ff26a87 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -26,6 +26,7 @@ jobs: runs-on: ubuntu-latest outputs: condition: ${{ steps.check.outputs.condition }} + ref: ${{ steps.check.outputs.ref }} steps: - name: Check if PR is from external contributor id: check @@ -45,6 +46,7 @@ jobs: else echo "condition=pr-creation-maintainer" >> $GITHUB_OUTPUT echo "Setting condition=pr-creation-maintainer (internal PR creation)" + echo "ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT fi elif [ "${{ github.event_name }}" == "repository_dispatch" ]; then # For repository_dispatch events (ok-to-test), check if sha matches @@ -58,6 +60,7 @@ jobs: if [ -n "$SHA_PARAM" ] && [[ "$PR_HEAD_SHA" == *"$SHA_PARAM"* ]]; then echo "condition=dispatch-event" >> $GITHUB_OUTPUT echo "Setting condition=dispatch-event (sha matches)" + echo "ref=$PR_HEAD_SHA" >> $GITHUB_OUTPUT else echo "condition=skip" >> $GITHUB_OUTPUT echo "Setting condition=skip (sha does not match or empty)" @@ -65,6 +68,7 @@ jobs: elif [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref_name }}" == "main" ]; then echo "condition=push-to-main" >> $GITHUB_OUTPUT echo "Setting condition=push-to-main (push to main)" + echo "ref=${{ github.sha }}" >> $GITHUB_OUTPUT else # Unknown event type echo "condition=skip" >> $GITHUB_OUTPUT @@ -80,6 +84,8 @@ jobs: || needs.check-external-pr.outputs.condition == 'push-to-main' uses: ./.github/workflows/e2e-tests.yml + with: + ref: ${{ needs.check-external-pr.outputs.ref }} secrets: OP_CONNECT_CREDENTIALS: ${{ secrets.OP_CONNECT_CREDENTIALS }} OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }} From 1dfe1fc19e689320ad08b3ae0027c265a1e3e45c Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Tue, 27 Jan 2026 14:19:04 -0600 Subject: [PATCH 2/2] Build action before testing --- .github/workflows/e2e-tests.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 3036f59..3105fb6 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -41,6 +41,18 @@ jobs: fetch-depth: 0 ref: ${{ inputs.ref }} + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build actions + run: npm run build:all + - name: Generate .env.tpl shell: bash run: | @@ -109,6 +121,18 @@ jobs: fetch-depth: 0 ref: ${{ inputs.ref }} + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build actions + run: npm run build:all + - name: Generate .env.tpl run: | mkdir -p tests