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 72473f4
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/check_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,33 @@ 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 }}
run: |
echo "Base ref: ${BASE_REF}"
echo "Head ref: ${HEAD_REF}"
echo "Fork owner: ${FORK_OWNER}"
- name: Add main repository as remote
run: |
git remote add origin https://github.com/ECP-WarpX/WarpX.git
- name: Add forked repository as remote
run: |
git remote add ${FORK_OWNER} https://github.com/${FORK_OWNER}/${github.event.pull_request.head.repo.name}.git
- name: Fetch base branch from main repository
run: |
git fetch origin ${BASE_REF}
- name: Fetch head branch from forked repository
run: |
git fetch ${FORK_OWNER} ${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_OWNER}/${HEAD_REF} > check_diff.txt
- name: Check changed files
run: |
if grep -v -E "^(docs|\.github)/" check_diff.txt; then
Expand All @@ -26,4 +50,4 @@ jobs:
echo "skip=true" >> ${GITHUB_OUTPUT}
fi
outputs:
skip: ${{ steps.check.outputs.skip_workflows }}
skip: ${{ steps.check.outputs.skip }}

0 comments on commit 72473f4

Please sign in to comment.