From e08904cb48c1c4c71ed693fbc49667f172a666f9 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 22:48:49 +0900 Subject: [PATCH 01/17] =?UTF-8?q?Chore:=20=ED=86=B5=ED=95=A9=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/integration.yaml | 35 +++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index ddb30c25d..56015f2a8 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -15,13 +15,27 @@ jobs: - name: Get PR labels id: pr-labels run: | - labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels -q '.labels[].name' || echo "") - echo "labels=$labels" >> $GITHUB_OUTPUT + pr_number="${{ github.event.pull_request.number }}" + labels_json=$(gh pr view $pr_number --json labels -q '.labels[].name') + if [ -n "$labels_json" ]; then + echo "has_maintenance=$(echo $labels_json | grep -q 'maintenance' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT + else + echo "has_maintenance=false" >> $GITHUB_OUTPUT + fi env: GH_TOKEN: ${{ github.token }} - name: Check for 1. missing end line breaks and 2. control characters in filenames and 3. filename rules run: | + # 필요한 값들 미리 설정 + pr_author="${{ github.event.pull_request.user.login }}" + pr_number="${{ github.event.pull_request.number }}" + labels_json=$(gh pr view $pr_number --json labels -q '.labels[].name') + has_maintenance=false + if echo "$labels_json" | grep -q "maintenance"; then + has_maintenance=true + fi + # 따옴표를 제거하고 파일 목록 가져오기 files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | tr -d '"') echo "변경된 파일 목록:" @@ -71,16 +85,15 @@ jobs: done # maintenance 라벨이 없는 경우에만 파일명 규칙 체크 - if [[ ! "${{ steps.pr-labels.outputs.labels }}" =~ "maintenance" ]]; then + if [ "$has_maintenance" != "true" ]; then echo -e "\n## 파일명 규칙 위반" >> $GITHUB_STEP_SUMMARY for file in $files; do if [ -f "$file" ]; then - filename=$(basename "$file" | tr -d '"') - github_username="${{ github.event.pull_request.user.login }}" - + # 파일명만 추출 (경로 제외) + filename=$(basename "$file") # 파일명이 GitHub계정명인지 확인 - if [[ ! "$filename" =~ ^"$github_username" ]]; then - echo "- $file (파일명은 '$github_username'로 해주셔야 합니다)" >> $GITHUB_STEP_SUMMARY + if [[ ! "$filename" =~ ^${pr_author} ]]; then + echo "- $file (파일명은 '$pr_author'형식으로 해주셔야 합니다)" >> $GITHUB_STEP_SUMMARY success=false fi fi @@ -91,8 +104,10 @@ jobs: echo -e "\n:warning: 위 문제들을 해결해 주세요:" >> $GITHUB_STEP_SUMMARY echo "1. 파일 끝의 누락된 줄바꿈을 추가해 주세요." >> $GITHUB_STEP_SUMMARY echo "2. 파일명에서 제어문자를 제거해 주세요." >> $GITHUB_STEP_SUMMARY - if [[ ! "${{ steps.pr-labels.outputs.labels }}" =~ "maintenance" ]]; then - echo "3. 파일명은 반드시 'GitHub계정명'으로 해주셔야 합니다. (예: ${{ github.event.pull_request.user.login }}.ts)" >> $GITHUB_STEP_SUMMARY + if [[ ! "$pr_labels" =~ "maintenance" ]]; then + echo "3. 파일명은 반드시 'GitHub계정명'형식으로 해주셔야 합니다. (예: ${pr_author}.ts)" >> $GITHUB_STEP_SUMMARY fi exit 1 fi + env: + GH_TOKEN: ${{ github.token }} From 3e5d35eb496c3442a17c57914faadc1922fc740d Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 22:50:32 +0900 Subject: [PATCH 02/17] test update --- alien-dictionary/hckang.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 alien-dictionary/hckang.ts diff --git a/alien-dictionary/hckang.ts b/alien-dictionary/hckang.ts new file mode 100644 index 000000000..ec10f3e9d --- /dev/null +++ b/alien-dictionary/hckang.ts @@ -0,0 +1 @@ +console.log('hi'); From b46f6de8878e00ac0bf5b1ca96ed6874ff191f1d Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 22:52:03 +0900 Subject: [PATCH 03/17] test update --- alien-dictionary/{hckang.ts => hc-kang1.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename alien-dictionary/{hckang.ts => hc-kang1.ts} (100%) diff --git a/alien-dictionary/hckang.ts b/alien-dictionary/hc-kang1.ts similarity index 100% rename from alien-dictionary/hckang.ts rename to alien-dictionary/hc-kang1.ts From 2373e7479a47e7b31442e583afdfcdf49df1d916 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 22:53:17 +0900 Subject: [PATCH 04/17] test update --- alien-dictionary/HC-kang.ts | 1 + alien-dictionary/hc-kang1.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 alien-dictionary/hc-kang1.ts diff --git a/alien-dictionary/HC-kang.ts b/alien-dictionary/HC-kang.ts index 034d24174..e62ef8941 100644 --- a/alien-dictionary/HC-kang.ts +++ b/alien-dictionary/HC-kang.ts @@ -64,4 +64,5 @@ function alienOrder(words: string[]): string { return result.length === Object.keys(inDegree).length // ? result.join('') : ''; + } diff --git a/alien-dictionary/hc-kang1.ts b/alien-dictionary/hc-kang1.ts deleted file mode 100644 index ec10f3e9d..000000000 --- a/alien-dictionary/hc-kang1.ts +++ /dev/null @@ -1 +0,0 @@ -console.log('hi'); From 64d442955ccdb5434accdead9c85150f72002501 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 22:56:45 +0900 Subject: [PATCH 05/17] =?UTF-8?q?Chore:=20=ED=86=B5=ED=95=A9=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 56015f2a8..f889a1fdd 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -92,7 +92,7 @@ jobs: # 파일명만 추출 (경로 제외) filename=$(basename "$file") # 파일명이 GitHub계정명인지 확인 - if [[ ! "$filename" =~ ^${pr_author} ]]; then + if ! echo "$filename" | grep -q "^${pr_author}-"; then echo "- $file (파일명은 '$pr_author'형식으로 해주셔야 합니다)" >> $GITHUB_STEP_SUMMARY success=false fi From 802797efd5d7a14b6e1eb99bf587797c3f21040c Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 22:57:34 +0900 Subject: [PATCH 06/17] test update --- alien-dictionary/HC-kang.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/alien-dictionary/HC-kang.ts b/alien-dictionary/HC-kang.ts index e62ef8941..546570198 100644 --- a/alien-dictionary/HC-kang.ts +++ b/alien-dictionary/HC-kang.ts @@ -65,4 +65,5 @@ function alienOrder(words: string[]): string { ? result.join('') : ''; + } From 0453a94aa172b582e355f3021d9fc576669d8731 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:00:06 +0900 Subject: [PATCH 07/17] =?UTF-8?q?Chore:=20=ED=86=B5=ED=95=A9=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index f889a1fdd..e7e68f167 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -92,7 +92,7 @@ jobs: # 파일명만 추출 (경로 제외) filename=$(basename "$file") # 파일명이 GitHub계정명인지 확인 - if ! echo "$filename" | grep -q "^${pr_author}-"; then + if ! echo "$filename" | grep -q "^${pr_author}"; then echo "- $file (파일명은 '$pr_author'형식으로 해주셔야 합니다)" >> $GITHUB_STEP_SUMMARY success=false fi From 055f2b5951d359662f0e76cd0bda64ba4f5ff781 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:01:23 +0900 Subject: [PATCH 08/17] Test: first test --- alien-dictionary/HC-kang.ts | 2 -- alien-dictionary/hckang.ts | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 alien-dictionary/hckang.ts diff --git a/alien-dictionary/HC-kang.ts b/alien-dictionary/HC-kang.ts index 546570198..034d24174 100644 --- a/alien-dictionary/HC-kang.ts +++ b/alien-dictionary/HC-kang.ts @@ -64,6 +64,4 @@ function alienOrder(words: string[]): string { return result.length === Object.keys(inDegree).length // ? result.join('') : ''; - - } diff --git a/alien-dictionary/hckang.ts b/alien-dictionary/hckang.ts new file mode 100644 index 000000000..ec10f3e9d --- /dev/null +++ b/alien-dictionary/hckang.ts @@ -0,0 +1 @@ +console.log('hi'); From 19f3cbaddbbfd70121d7b1e130b8ade8483b83e1 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:02:23 +0900 Subject: [PATCH 09/17] test update --- alien-dictionary/{hckang.ts => hc-kang-1.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename alien-dictionary/{hckang.ts => hc-kang-1.ts} (100%) diff --git a/alien-dictionary/hckang.ts b/alien-dictionary/hc-kang-1.ts similarity index 100% rename from alien-dictionary/hckang.ts rename to alien-dictionary/hc-kang-1.ts From 2ab4847915a104d4ab952aa13d79bc9115009e68 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:06:07 +0900 Subject: [PATCH 10/17] =?UTF-8?q?Chore:=20=ED=86=B5=ED=95=A9=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index e7e68f167..97cebf6f1 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -92,7 +92,7 @@ jobs: # 파일명만 추출 (경로 제외) filename=$(basename "$file") # 파일명이 GitHub계정명인지 확인 - if ! echo "$filename" | grep -q "^${pr_author}"; then + if ! [[ "$filename" = "$pr_author"* ]]; then echo "- $file (파일명은 '$pr_author'형식으로 해주셔야 합니다)" >> $GITHUB_STEP_SUMMARY success=false fi From 10e03ed340037bad9b87df69e66642fde150dc8e Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:06:39 +0900 Subject: [PATCH 11/17] test update --- alien-dictionary/HC-kang.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/alien-dictionary/HC-kang.ts b/alien-dictionary/HC-kang.ts index 034d24174..8a49377c9 100644 --- a/alien-dictionary/HC-kang.ts +++ b/alien-dictionary/HC-kang.ts @@ -64,4 +64,5 @@ function alienOrder(words: string[]): string { return result.length === Object.keys(inDegree).length // ? result.join('') : ''; + } From cd9e9b495620b90887cb480615804c3a6d3b5440 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:09:08 +0900 Subject: [PATCH 12/17] =?UTF-8?q?Chore:=20=ED=86=B5=ED=95=A9=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 97cebf6f1..c6ad3bda4 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -92,7 +92,7 @@ jobs: # 파일명만 추출 (경로 제외) filename=$(basename "$file") # 파일명이 GitHub계정명인지 확인 - if ! [[ "$filename" = "$pr_author"* ]]; then + if ! echo "$filename" | grep -q "^${pr_author}\|^${pr_author}-"; then echo "- $file (파일명은 '$pr_author'형식으로 해주셔야 합니다)" >> $GITHUB_STEP_SUMMARY success=false fi From 7fa123c402e5ed14b3eebe26285d4b1c7979933e Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:09:53 +0900 Subject: [PATCH 13/17] test update --- alien-dictionary/HC-kang.ts | 1 + alien-dictionary/hc-kang-1.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/alien-dictionary/HC-kang.ts b/alien-dictionary/HC-kang.ts index 8a49377c9..6aef6aab1 100644 --- a/alien-dictionary/HC-kang.ts +++ b/alien-dictionary/HC-kang.ts @@ -65,4 +65,5 @@ function alienOrder(words: string[]): string { ? result.join('') : ''; + } diff --git a/alien-dictionary/hc-kang-1.ts b/alien-dictionary/hc-kang-1.ts index ec10f3e9d..a71b9ecd6 100644 --- a/alien-dictionary/hc-kang-1.ts +++ b/alien-dictionary/hc-kang-1.ts @@ -1 +1,2 @@ console.log('hi'); +console.log('hi'); From e18261ba89545c1bad051e676f4ae090c5cf4aec Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:11:55 +0900 Subject: [PATCH 14/17] test update --- alien-dictionary/HC-kang.ts | 1 + alien-dictionary/hc-kang-1.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/alien-dictionary/HC-kang.ts b/alien-dictionary/HC-kang.ts index 6aef6aab1..8563ab670 100644 --- a/alien-dictionary/HC-kang.ts +++ b/alien-dictionary/HC-kang.ts @@ -66,4 +66,5 @@ function alienOrder(words: string[]): string { : ''; + } diff --git a/alien-dictionary/hc-kang-1.ts b/alien-dictionary/hc-kang-1.ts index a71b9ecd6..58101d7f3 100644 --- a/alien-dictionary/hc-kang-1.ts +++ b/alien-dictionary/hc-kang-1.ts @@ -1,2 +1,3 @@ console.log('hi'); + console.log('hi'); From 2d022fafbc941e7a2317ecc516cac855cdfaa7a6 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:12:41 +0900 Subject: [PATCH 15/17] test update --- alien-dictionary/HC-kang.ts | 1 + alien-dictionary/hc-kang-1.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/alien-dictionary/HC-kang.ts b/alien-dictionary/HC-kang.ts index 8563ab670..9a1ebc028 100644 --- a/alien-dictionary/HC-kang.ts +++ b/alien-dictionary/HC-kang.ts @@ -67,4 +67,5 @@ function alienOrder(words: string[]): string { + } diff --git a/alien-dictionary/hc-kang-1.ts b/alien-dictionary/hc-kang-1.ts index 58101d7f3..6948ace64 100644 --- a/alien-dictionary/hc-kang-1.ts +++ b/alien-dictionary/hc-kang-1.ts @@ -1,3 +1,4 @@ console.log('hi'); + console.log('hi'); From 9a87865860b4b47b9c6b2e6e7dcd83e4feb2cc59 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:14:33 +0900 Subject: [PATCH 16/17] =?UTF-8?q?Chore:=20=ED=86=B5=ED=95=A9=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/integration.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index c6ad3bda4..a4fde7ea6 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -92,7 +92,8 @@ jobs: # 파일명만 추출 (경로 제외) filename=$(basename "$file") # 파일명이 GitHub계정명인지 확인 - if ! echo "$filename" | grep -q "^${pr_author}\|^${pr_author}-"; then + shopt -s nocasematch + if [[ ! "$filename" = "$pr_author"* ]]; then echo "- $file (파일명은 '$pr_author'형식으로 해주셔야 합니다)" >> $GITHUB_STEP_SUMMARY success=false fi From 278b0731251f6661f6fd1a677946d437b2d40633 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Fri, 29 Nov 2024 23:15:03 +0900 Subject: [PATCH 17/17] Test: first test --- alien-dictionary/HC-kang.ts | 1 + alien-dictionary/hc-kang-1.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/alien-dictionary/HC-kang.ts b/alien-dictionary/HC-kang.ts index 9a1ebc028..f2ba71dcd 100644 --- a/alien-dictionary/HC-kang.ts +++ b/alien-dictionary/HC-kang.ts @@ -67,5 +67,6 @@ function alienOrder(words: string[]): string { + } diff --git a/alien-dictionary/hc-kang-1.ts b/alien-dictionary/hc-kang-1.ts index 6948ace64..809b8e6a1 100644 --- a/alien-dictionary/hc-kang-1.ts +++ b/alien-dictionary/hc-kang-1.ts @@ -1,4 +1,5 @@ console.log('hi'); + console.log('hi');