Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Actions 추가 #901

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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: echo "::set-output name=changed_files::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | wc -l)"

- name: Check File Count
run: |
changed_files=${{ steps.count_files.outputs.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