Skip to content

Commit

Permalink
{CI} Auto-version-calculation fix (#7233)
Browse files Browse the repository at this point in the history
* add ref checkout
  • Loading branch information
AllyW committed Feb 1, 2024
1 parent f0167ba commit edf4d02
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/VersionCalPRComment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
uses: actions/checkout@master
with:
fetch-depth: 0 # checkout all branches
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}} # checkout pull request branch
- name: Show workdirectory after site cloned
run: |
pwd
Expand All @@ -34,20 +36,15 @@ jobs:
run: |
echo github.event.pull_request.base.sha: ${{github.event.pull_request.base.sha}}
echo github.event.pull_request.base.ref: ${{ github.event.pull_request.base.ref }}
echo github.event.pull_request.head.sha: ${{ github.event.pull_request.head.sha }}
echo github.event.pull_request.head.ref: ${{ github.event.pull_request.head.ref }}
echo github.event.pull_request.head.repo.full_name: ${{ github.event.pull_request.head.repo.full_name }}
echo github.sha: ${{github.sha}}
echo GITHUB_BASE_REF: ${GITHUB_BASE_REF}
echo GITHUB_HEAD_REF: ${GITHUB_HEAD_REF}
echo GITHUB_SHA: ${GITHUB_SHA}
echo GITHUB_REF: ${GITHUB_REF}
echo "base_branch=${GITHUB_BASE_REF}" >> $GITHUB_ENV
echo "diff_branch=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
echo "base_commit=${GITHUB_SHA}" >> $GITHUB_ENV
echo "diff_commit=${GITHUB_SHA}" >> $GITHUB_ENV
git --version
git log --oneline | head -n 30
echo git branch -a
git branch -a
git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} > changed_files
git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} > 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 @@ -95,8 +92,8 @@ jobs:
run: |
chmod +x env/bin/activate
source ./env/bin/activate
echo GITHUB_BASE_REF: ${GITHUB_BASE_REF}
git checkout ${GITHUB_BASE_REF}
echo github.event.pull_request.base.ref: ${{ github.event.pull_request.base.ref }}
git checkout ${{ github.event.pull_request.base.ref }}
for mod in `cat changed_modules`
do
echo **************************
Expand All @@ -107,8 +104,8 @@ jobs:
echo **************************
echo -e "\n\n\n\n\n"
done
echo GITHUB_HEAD_REF: ${GITHUB_HEAD_REF}
git checkout ${GITHUB_HEAD_REF}
echo github.event.pull_request.head.ref: ${{ github.event.pull_request.head.ref }}
git checkout ${{ github.event.pull_request.head.ref }}
for mod in `cat changed_modules`
do
echo **************************
Expand Down

0 comments on commit edf4d02

Please sign in to comment.