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 }}