99 - ' .github/workflows/**'
1010 - ' **/*.md'
1111 - ' test/**'
12- - ' backup/**/* '
12+ - ' backup/**'
1313 workflow_dispatch :
1414
1515permissions :
@@ -131,11 +131,6 @@ jobs:
131131 uses : actions/checkout@v6
132132 with :
133133 fetch-depth : 10
134- # token: ${{ secrets.ACCESS_TOKEN }}
135-
136- # - name: Create Test File
137- # run: |
138- # echo "$(date +%s)-$RANDOM" > test/test2.txt
139134
140135 - name : Test Auto Branch Local Action (auto_branch false)
141136 uses : ./
@@ -186,22 +181,6 @@ jobs:
186181 github_token : ${{ secrets.PAT_TOKEN }}
187182 pr_closed : true
188183
189- # - name: Create Test File
190- # run: |
191- # echo "$(date +%s)-$RANDOM" > test/test3.txt
192-
193- # - name: Test User Branch Local Action
194- # uses: ./
195- # with:
196- # user_email: actions@github.com
197- # user_name: GitHub Actions
198- # create_pr: true
199- # auto_branch: false
200- # branch: feature/pr-test-branch
201- # pr_base: main
202- # repository_path: test
203- # file_pattern: .
204-
205184 test-skip-if-empty :
206185 name : Test Skip If Empty
207186 runs-on : ubuntu-latest
@@ -231,7 +210,7 @@ jobs:
231210 github_token : ${{ secrets.PAT_TOKEN }}
232211 pr_closed : true
233212
234- # 변경사항이 있을 때는 skip되지 않는지 확인
213+ # Verify skip does not happen when changes exist
235214 - name : Create Test File
236215 run : |
237216 echo "$(date +%s)-$RANDOM" > test/skip-test.txt
@@ -288,113 +267,18 @@ jobs:
288267 This PR will be automatically closed after creation.
289268 github_token : ${{ secrets.PAT_TOKEN }}
290269
291- # test-multi-file-pattern:
292- # name: Test Multiple File Pattern
293- # runs-on: ubuntu-latest
294- # needs: [test-pr-auto-close-pr-body]
295-
296- # steps:
297- # - name: Checkout
298- # uses: actions/checkout@v6
299- # with:
300- # fetch-depth: 10
301- # token: ${{ secrets.PAT_TOKEN }}
302-
303- # - name: Setup Git User
304- # run: |
305- # git config --global user.email "actions@github.com"
306- # git config --global user.name "GitHub Actions"
307-
308- # - name: Create Test Files and Add to Git
309- # run: |
310- # # 테스트 디렉토리 생성
311- # mkdir -p test/multi-pattern
312- # cd test/multi-pattern
313-
314- # # 테스트 파일 생성
315- # echo "Test file 1 - $(date +%s)" > file1.txt
316- # echo "Test file 2 - $(date +%s)" > file2.md
317- # echo "Test file 3 - $(date +%s)" > file3.json
318- # echo "Test file 4 - $(date +%s)" > file4.txt
319-
320- # # 파일 확인
321- # echo "디렉토리 내용:"
322- # ls -la
323-
324- # # 경로 돌아가기
325- # cd ../..
326-
327- # - name: Test Commit with Multiple File Pattern (space separated)
328- # uses: ./
329- # with:
330- # user_email: actions@github.com
331- # user_name: GitHub Actions
332- # commit_message: "test: commit multiple files with space-separated pattern"
333- # branch: main # 메인 브랜치 사용
334- # repository_path: "test/multi-pattern" # 상대 경로 수정
335- # file_pattern: "file1.txt file2.md"
336-
337- # - name: Verify Files Added
338- # run: |
339- # git log -1 --name-status
340- # # Verify txt and md files were added but json was not
341- # if git log -1 --name-status | grep -q "test/multi-pattern/file1.txt" && \
342- # git log -1 --name-status | grep -q "test/multi-pattern/file2.md" && \
343- # ! git log -1 --name-status | grep -q "test/multi-pattern/file3.json"; then
344- # echo "✅ Test passed: Only specified patterns were committed"
345- # else
346- # echo "❌ Test failed: Incorrect files were committed"
347- # exit 1
348- # fi
349-
350- # - name: Test Commit with Another Multiple Pattern
351- # uses: ./
352- # with:
353- # user_email: actions@github.com
354- # user_name: GitHub Actions
355- # commit_message: "test: commit JSON file with separate pattern"
356- # branch: main # 메인 브랜치 사용
357- # repository_path: "test/multi-pattern" # 상대 경로 수정
358- # file_pattern: "file3.json file4.txt"
359-
360- # - name: Verify Second Pattern
361- # run: |
362- # git log -1 --name-status
363- # # Verify json and specific txt file were added
364- # if git log -1 --name-status | grep -q "test/multi-pattern/file3.json" && \
365- # git log -1 --name-status | grep -q "test/multi-pattern/file4.txt"; then
366- # echo "✅ Test passed: Second pattern correctly committed files"
367- # else
368- # echo "❌ Test failed: Second pattern did not commit correct files"
369- # exit 1
370- # fi
371-
372270 test-pr-dry-run :
373271 name : Test PR Dry Run
374272 runs-on : ubuntu-latest
375273 needs : [test-pr-auto-close-pr-body]
376- # needs: [test-multi-file-pattern]
377274
378275 steps :
379276 - name : Checkout
380277 uses : actions/checkout@v6
381278 with :
382279 fetch-depth : 10
383280 token : ${{ secrets.PAT_TOKEN }}
384-
385- # - name: Create Test File for PR and Add to Git
386- # run: |
387- # mkdir -p test
388- # echo "Test file for PR dry run - $(date +%s)" > test/pr-dry-run-test.txt
389-
390- # # 파일 확인
391- # echo "생성된 PR 테스트 파일:"
392- # ls -la test/
393-
394- # # 경로 돌아가기
395- # cd ../..
396-
397-
281+
398282 - name : Test PR Dry Run (auto_branch false)
399283 uses : ./
400284 with :
@@ -411,4 +295,25 @@ jobs:
411295 file_pattern : " pr-dry-run-test.txt"
412296 github_token : ${{ secrets.PAT_TOKEN }}
413297 pr_dry_run : true
414-
298+
299+ ci-result :
300+ name : CI Result
301+ if : always()
302+ needs :
303+ - unit-tests
304+ - build-and-push-docker
305+ - test-action-auto-branch-false
306+ - test-action-auto-branch-true
307+ - test-skip-if-empty
308+ - test-pr-auto-close-pr-body
309+ - test-pr-dry-run
310+ runs-on : ubuntu-latest
311+ steps :
312+ - name : Check all jobs
313+ run : |
314+ if [ "${{ contains(needs.*.result, 'failure') }}" = "true" ] || \
315+ [ "${{ contains(needs.*.result, 'cancelled') }}" = "true" ]; then
316+ echo "[FAIL]Some jobs failed or were cancelled"
317+ exit 1
318+ fi
319+ echo "[PASS]All CI jobs passed"
0 commit comments