Skip to content

Commit

Permalink
Merge pull request #299 from ShotaroMatsuya/test/test-1
Browse files Browse the repository at this point in the history
test
  • Loading branch information
ShotaroMatsuya authored Aug 28, 2024
2 parents d7a69bd + c9354c7 commit 4df26dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test_changed_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/github-script@v7
- uses: actions/github-script@v6
id: set-target-branch
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand Down Expand Up @@ -43,9 +43,11 @@ jobs:
fetch-depth: 1
ref: ${{ steps.set-target-branch.outputs.head_ref }}

- name: Check diff between base and head
- name: Find common ancestor and check diff
run: |
files=($(git diff origin/${{ steps.set-target-branch.outputs.base_ref }}...HEAD --name-only | tr '\n' ' '))
merge_base=$(git merge-base origin/${{ steps.set-target-branch.outputs.base_ref }} HEAD)
echo "Merge base commit: $merge_base"
files=($(git diff $merge_base HEAD --name-only | tr '\n' ' '))
for file in "${files[@]}"; do
echo "${file}"
done
done

0 comments on commit 4df26dd

Please sign in to comment.