Skip to content

Commit

Permalink
Debug new workflow to check files
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Nov 16, 2024
1 parent 093fdf4 commit 29c9899
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/check_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,34 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Define base and head refs
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
FORK_OWNER: ${{ github.event.pull_request.head.repo.owner.login }}
FORK_REPO: ${{ github.event.pull_request.head.repo.name }}
run: |
echo "Base ref: ${BASE_REF}"
echo "Head ref: ${HEAD_REF}"
echo "Fork owner: ${FORK_OWNER}"
echo "Fork repo: ${FORK_REPO}"
- name: Add forked repository as remote
env:
FORK_URL: https://github.com/${FORK_OWNER}/${FORK_REPO}.git
run: |
git remote add fork ${FORK_URL}
- name: Fetch base branch from main repository
run: |
git fetch origin ${BASE_REF}
- name: Fetch head branch from forked repository
run: |
git fetch fork ${HEAD_REF}
- name: Get changed files
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
git diff --name-only --diff-filter=ACMRTUXB ${GITHUB_BASE_REF}..${GITHUB_HEAD_REF} > check_diff.txt
git diff --name-only --diff-filter=ACMRTUXB origin/${BASE_REF}..fork/${HEAD_REF} > check_diff.txt
- name: Check changed files
run: |
if grep -v -E "^(docs|\.github)/" check_diff.txt; then
Expand All @@ -26,4 +51,4 @@ jobs:
echo "skip=true" >> ${GITHUB_OUTPUT}
fi
outputs:
skip: ${{ steps.check.outputs.skip_workflows }}
skip: ${{ steps.check.outputs.skip }}

0 comments on commit 29c9899

Please sign in to comment.