Skip to content

Commit

Permalink
add upstream branch name prefix to avoid conflict (Azure#7384)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllyW authored Mar 15, 2024
1 parent 414f8a3 commit bee5500
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/VersionCalPRComment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
env:
bash_sha: ${{ github.event.pull_request.base.sha }}
base_branch: ${{ github.event.pull_request.base.ref }}
base_branch_pre: "upstream"
diff_sha: ${{ github.event.pull_request.head.sha }}
diff_branch: ${{ github.event.pull_request.head.ref }}
repo_full_name: ${{ github.event.pull_request.head.repo.full_name }}
Expand All @@ -44,12 +45,12 @@ jobs:
git --version
git log --oneline | head -n 30
git branch -a
git fetch https://github.com/Azure/azure-cli-extensions.git ${{ env.base_branch }}:${{ env.base_branch }}
git checkout ${{ env.base_branch }}
git fetch https://github.com/Azure/azure-cli-extensions.git ${{ env.base_branch }}:${{ env.base_branch_pre }}/${{ env.base_branch }}
git checkout ${{ env.base_branch_pre }}/${{ env.base_branch }}
git log --oneline | head -n 30
git checkout ${{ env.diff_branch }}
git log --oneline | head -n 30
git --no-pager diff --name-only --diff-filter=ACMRT ${{ env.base_branch }}...${{ env.diff_branch }} > changed_files
git --no-pager diff --name-only --diff-filter=ACMRT ${{ env.base_branch_pre }}/${{ env.base_branch }}...${{ env.diff_branch }} > changed_files
cat changed_files
cat changed_files | grep azext_ | awk -F"azext_" '{print $1}'| awk -F"/" '{print $2}' | sort | uniq > changed_modules
echo "changed_module_list=$(cat changed_files | grep azext_ | awk -F"azext_" '{print $1}'| awk -F"/" '{print $2}' | sort | uniq | xargs)" >> $GITHUB_ENV
Expand Down Expand Up @@ -92,6 +93,7 @@ jobs:
env:
pr_label_list: ${{ toJson(github.event.pull_request.labels.*.name) }}
base_branch: ${{ github.event.pull_request.base.ref }}
base_branch_pre: "upstream"
diff_branch: ${{ github.event.pull_request.head.ref }}
base_meta_path: "./base_meta/"
diff_meta_path: "./diff_meta/"
Expand All @@ -100,7 +102,7 @@ jobs:
chmod +x env/bin/activate
source ./env/bin/activate
set -ev
git checkout ${{ env.base_branch }}
git checkout ${{ env.base_branch_pre }}/${{ env.base_branch }}
mkdir ${{ env.base_meta_path }}
for mod in ${{ env.changed_module_list }}
do
Expand All @@ -116,7 +118,7 @@ jobs:
done
ls ./${{ env.base_meta_path }}/
ls ./${{ env.diff_meta_path }}/
git checkout ${{ env.base_branch }}
git checkout ${{ env.base_branch_pre }}/${{ env.base_branch }}
python scripts/ci/release_version_cal.py
# echo "commit_message=$(cat ${{ env.output_file }})" >> $GITHUB_ENV
- name: Comment on the pull request
Expand Down

0 comments on commit bee5500

Please sign in to comment.