@@ -24,12 +24,14 @@ jobs:
2424 fetch-depth : 0
2525
2626 - name : Check the Validity of Hyperlinks
27+ env :
28+ BASE_SHA : ${{ github.event.pull_request.base.sha }}
2729 run : |
2830 cd ${{github.workspace}}
2931 delay=1
3032 fail="FALSE"
3133 merged_commit=$(git log -1 --format='%H')
32- changed_files="$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '/\.md$/ {print $NF}')"
34+ changed_files="$(git diff --name-status --diff-filter=ARM $BASE_SHA ${merged_commit} | awk '/\.md$/ {print $NF}')"
3335 if [ -n "$changed_files" ]; then
3436 for changed_file in $changed_files; do
3537 # echo $changed_file
@@ -87,15 +89,18 @@ jobs:
8789 fetch-depth : 0
8890
8991 - name : Checking Relative Path Validity
92+ env :
93+ REPO_NAME : ${{ github.event.pull_request.head.repo.full_name }}
94+ HEAD_REF : ${{ github.event.pull_request.head.ref }}
95+ BASE_SHA : ${{ github.event.pull_request.base.sha }}
9096 run : |
9197 cd ${{github.workspace}}
9298 delay=1
9399 fail="FALSE"
94- repo_name=${{ github.event.pull_request.head.repo.full_name }}
95- branch="https://github.com/$repo_name/blob/${{ github.event.pull_request.head.ref }}"
100+ branch="https://github.com/$REPO_NAME/blob/$HEAD_REF"
96101
97102 merged_commit=$(git log -1 --format='%H')
98- changed_files="$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '/\.md$/ {print $NF}')"
103+ changed_files="$(git diff --name-status --diff-filter=ARM $BASE_SHA ${merged_commit} | awk '/\.md$/ {print $NF}')"
99104 png_lines=$(grep -Eo '\]\([^)]+\)' --include='*.md' -r .|grep -Ev 'http')
100105 if [ -n "$png_lines" ]; then
101106 for png_line in $png_lines; do
0 commit comments