Skip to content

fix: gitAction 로직 수정 #3

fix: gitAction 로직 수정

fix: gitAction 로직 수정 #3

Workflow file for this run

name: Check Changed Files in PR
on:
pull_request:
paths:
- '**/*' # 모든 경로에서 이벤트 감지
jobs:
check_changed_files:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Count Changed Files
id: count_files
run: |
git diff --numstat ${{ github.event.before }} ${{ github.sha }} > temp.diff
changed_files=$(wc -l < temp.diff)
echo "::set-output name=changed_files::$changed_files"
- name: Check File Count
run: |
changed_files=${{ steps.count_files.outputs.changed_files }}
echo "Changed files count: $changed_files"
if [ $changed_files -eq 1 ]; then
echo "Only 1 file changed. Workflow continues."
else
echo "More than 1 file changed. Exiting the workflow."
exit 1
fi