From b1c2736d5044fef1bec3578624830468ce07cc00 Mon Sep 17 00:00:00 2001 From: EduardGomezEscandell Date: Wed, 20 Sep 2023 13:48:57 +0200 Subject: [PATCH] Point WSL-Pro-Service to current branch --- .github/actions/update-workspace-dependencies/action.yaml | 8 +++++++- .../update-workspace-dependencies.sh | 6 +++--- .github/workflows/qa-azure.yaml | 5 +++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/actions/update-workspace-dependencies/action.yaml b/.github/actions/update-workspace-dependencies/action.yaml index 5f33fba5a..14a93f0e8 100644 --- a/.github/actions/update-workspace-dependencies/action.yaml +++ b/.github/actions/update-workspace-dependencies/action.yaml @@ -5,6 +5,9 @@ inputs: module: description: The go module to update the dependencies of required: true + target_ref: + description: Optionally change what git ref to point the dependencies to + required: false runs: using: "composite" @@ -18,5 +21,8 @@ runs: shell: bash run: | chmod +x ${{ github.action_path }}/update-workspace-dependencies.sh - ${{ github.action_path }}/update-workspace-dependencies.sh "${{ github.repository }}" "wsl-pro-service" + ${{ github.action_path }}/update-workspace-dependencies.sh \ + "${{ github.repository }}" \ + "wsl-pro-service" \ + ${{ inputs.target_ref }} diff --git a/.github/actions/update-workspace-dependencies/update-workspace-dependencies.sh b/.github/actions/update-workspace-dependencies/update-workspace-dependencies.sh index 527a05b51..bfa5d9f2c 100755 --- a/.github/actions/update-workspace-dependencies/update-workspace-dependencies.sh +++ b/.github/actions/update-workspace-dependencies/update-workspace-dependencies.sh @@ -3,6 +3,7 @@ set -eu github_repo="${1:-""}" target_module="${2:-""}" +target_ref="${3:-"`git rev-parse HEAD~0`"}" if [[ -z "${github_repo}" || -z "${target_module}" ]] ; then echo "Update the out-of-date workspace dependencies of the target modules" @@ -19,7 +20,6 @@ if [[ -z "${github_repo}" || -z "${target_module}" ]] ; then fi cd ${target_module} -current_commit=$(git rev-parse HEAD~0) # Find internal dependencies repo="github.com/${github_repo}" @@ -39,7 +39,7 @@ for dependency in ${dependencies}; do dep_commit=`echo $dependency | sed "s#${pattern}#\4#"` export GIT_TERMINAL_PROMPT="0" - diff_files="$(git diff --name-only ${dep_commit} -- "../${dep_path}")" + diff_files="$(git diff --name-only ${dep_commit} -- "../${dep_path}" 2>&1)" if [ -z "${diff_files}" ] ; then continue fi @@ -49,7 +49,7 @@ for dependency in ${dependencies}; do echo "Files changed since commit ${dep_commit}:" echo "${diff_files}" - go get "${repo}/${dep_path}@${current_commit}" + go get "${repo}/${dep_path}@${target_ref}" echo "::endgroup::" done diff --git a/.github/workflows/qa-azure.yaml b/.github/workflows/qa-azure.yaml index cce547554..728cb2b50 100644 --- a/.github/workflows/qa-azure.yaml +++ b/.github/workflows/qa-azure.yaml @@ -73,6 +73,11 @@ jobs: New-Item -ItemType Directory "ci-build/windows-agent" Get-AppxPackage -Name "CanonicalGroupLimited.UbuntuProForWindows" | Remove-AppxPackage .\tools\build\build-appx.ps1 -OutputDir "ci-build/windows-agent" -SkipInstall + - name: Point WSL-Pro-Service to current branch + uses: ./.github/actions/update-workspace-dependencies + with: + module: ubuntu-pro-for-windows + target_ref: ${{ github.ref_name }} - name: Build WSL-Pro-Service shell: powershell run: |