diff --git a/.github/workflows/e2e-tests-windows.yml b/.github/workflows/e2e-tests-windows.yml index 0cfee2e4788c..bcfb4f38d865 100644 --- a/.github/workflows/e2e-tests-windows.yml +++ b/.github/workflows/e2e-tests-windows.yml @@ -19,20 +19,22 @@ env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 jobs: - get-changed-files: + windows-file-changed: runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Get changed files - id: get_changed_files - run: echo "::set-output name=files::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})" - - name: Print changed files - run: echo "${{ steps.get_changed_files.outputs.files }}" + with: + fetch-depth: 0 + - name: Did windows files changed + run: echo "changed=$(./.github/workflows/scripts/is_changed_file_windows.sh )" >> "$GITHUB_OUTPUT" + - run: echo $(./.github/workflows/scripts/is_changed_file_windows.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }} ) collector-build: runs-on: windows-latest - if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') }} + needs: [windows-file-changed] + if: ${{ github.actor != 'dependabot[bot]' && ((contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') || needs.windows-file-changed.outputs.changed == 'true') }} steps: - name: Checkout uses: actions/checkout@v4