diff --git a/.github/workflows/ios-end-to-end-tests.yml b/.github/workflows/ios-end-to-end-tests.yml index ea80d5d0b3fc..4aa336dd9fdf 100644 --- a/.github/workflows/ios-end-to-end-tests.yml +++ b/.github/workflows/ios-end-to-end-tests.yml @@ -12,6 +12,9 @@ on: arg_tests_json_key: type: string required: false + commit_hash: + type: string + required: false workflow_dispatch: inputs: # Optionally specify a test case or suite to run. @@ -75,10 +78,21 @@ jobs: needs: set-up-outputs-directory timeout-minutes: 20 steps: + - name: Set commit hash or default to github.sha + id: set-commit-hash + run: | + # If the input has a value, it is filled by that value; otherwise, use github.sha + if [ -n "${{ inputs.commit_hash }}" ]; then + echo "COMMIT_HASH=${{ inputs.commit_hash }}" >> $GITHUB_ENV + else + echo "COMMIT_HASH=${{ github.sha }}" >> $GITHUB_ENV + fi + shell: bash - name: Checkout repository uses: actions/checkout@v4 with: clean: true + ref: ${{ env.COMMIT_HASH }} - name: Configure Rust uses: actions-rs/toolchain@v1.0.6