Skip to content

Commit 8419c41

Browse files
committed
Debug new workflow to check files
1 parent 093fdf4 commit 8419c41

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/check_diff.yml

+21-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,28 @@ jobs:
1515
uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
18+
- name: Define base and head refs
19+
env:
20+
BASE_REF: ${{ github.event.pull_request.base.ref }}
21+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
22+
run: |
23+
echo "Base ref: ${BASE_REF}"
24+
echo "Head ref: ${HEAD_REF}"
25+
- name: Add forked repository as remote
26+
run: |
27+
git remote add fork ${{ github.event.pull_request.head.repo.clone_url }}
28+
- name: Fetch base branch from main repository
29+
run: |
30+
git fetch origin ${BASE_REF}
31+
- name: Fetch head branch from forked repository
32+
run: |
33+
git fetch fork ${HEAD_REF}
1834
- name: Get changed files
35+
env:
36+
BASE_REF: ${{ github.event.pull_request.base.ref }}
37+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
1938
run: |
20-
git diff --name-only --diff-filter=ACMRTUXB ${GITHUB_BASE_REF}..${GITHUB_HEAD_REF} > check_diff.txt
39+
git diff --name-only --diff-filter=ACMRTUXB origin/${BASE_REF}..fork/${HEAD_REF} > check_diff.txt
2140
- name: Check changed files
2241
run: |
2342
if grep -v -E "^(docs|\.github)/" check_diff.txt; then
@@ -26,4 +45,4 @@ jobs:
2645
echo "skip=true" >> ${GITHUB_OUTPUT}
2746
fi
2847
outputs:
29-
skip: ${{ steps.check.outputs.skip_workflows }}
48+
skip: ${{ steps.check.outputs.skip }}

0 commit comments

Comments
 (0)