diff --git a/.github/workflows/AzdevLinter.yml b/.github/workflows/AzdevLinter.yml index a9a5c21dd5e..c297df3cbae 100644 --- a/.github/workflows/AzdevLinter.yml +++ b/.github/workflows/AzdevLinter.yml @@ -18,6 +18,10 @@ jobs: steps: - name: Checkout CLI extension repo uses: actions/checkout@v4 + with: + fetch-depth: 1 + sparse-checkout: | + .github - name: Azdev Env Setup uses: ./.github/actions/env-setup - name: Get Diff Files @@ -46,6 +50,7 @@ jobs: cat changed_files cat changed_files | grep src/ | awk -F"src/" '{print $2}'| grep / | awk -F"/" '{print $1}' | sort | uniq echo "changed_module_list=$(cat changed_files | grep src/ | awk -F"src/" '{print $2}'| grep / | awk -F"/" '{print $1}' | sort | uniq | xargs)" >> $GITHUB_ENV + git checkout -f "$base_branch_pre"/"$base_branch" - name: Display PR Diff Modules run: | for mod in ${changed_module_list[@]} @@ -77,6 +82,7 @@ jobs: # always use the latest index.json and scripts from base branch git checkout "$base_branch_pre"/"$base_branch" -- scripts git checkout "$base_branch_pre"/"$base_branch" -- src/index.json + git checkout "$base_branch_pre"/"$base_branch" -- .github merge_base=$(git merge-base HEAD "$base_branch_pre"/"$base_branch") echo merge_base: "$merge_base" diff --git a/.github/workflows/AzdevStyle.yml b/.github/workflows/AzdevStyle.yml index 7c8e193afdc..2cea8c37efc 100644 --- a/.github/workflows/AzdevStyle.yml +++ b/.github/workflows/AzdevStyle.yml @@ -18,6 +18,10 @@ jobs: steps: - name: Checkout CLI extension repo uses: actions/checkout@v4 + with: + fetch-depth: 1 + sparse-checkout: | + .github - name: Azdev Env Setup uses: ./.github/actions/env-setup - name: Get Diff Files @@ -46,6 +50,7 @@ jobs: cat changed_files cat changed_files | grep src/ | awk -F"src/" '{print $2}'| grep / | awk -F"/" '{print $1}' | sort | uniq echo "changed_module_list=$(cat changed_files | grep src/ | awk -F"src/" '{print $2}'| grep / | awk -F"/" '{print $1}' | sort | uniq | xargs)" >> $GITHUB_ENV + git checkout -f "$base_branch_pre"/"$base_branch" - name: Display PR Diff Modules run: | for mod in ${changed_module_list[@]} @@ -76,7 +81,8 @@ jobs: git checkout -f "$diff_branch" # always use the latest index.json and scripts from base branch git checkout "$base_branch_pre"/"$base_branch" -- scripts - git checkout "$base_branch_pre"/"$base_branch" -- src/index.json + git checkout "$base_branch_pre"/"$base_branch" -- src/index.json + git checkout "$base_branch_pre"/"$base_branch" -- .github merge_base=$(git merge-base HEAD "$base_branch_pre"/"$base_branch") echo merge_base: "$merge_base"