diff --git a/.github/ISSUE_TEMPLATE/test-issue-template.yml b/.github/ISSUE_TEMPLATE/test-issue-template.yml new file mode 100644 index 0000000..465c4ef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/test-issue-template.yml @@ -0,0 +1,22 @@ +name: "πŸ’¬ Test" +description: "μ½”λ“œ ν…ŒμŠ€νŠΈ" +labels: ["test"] +body: + - type: textarea + attributes: + label: πŸ“„ μ„€λͺ… + description: κ²€μ¦ν•˜κ³ μž ν•˜λŠ” μ½”λ“œ λŒ€ν•œ μ„€λͺ…을 μž‘μ„±ν•΄ μ£Όμ„Έμš”. + placeholder: κ²€μ¦ν•˜κ³ μž ν•˜λŠ” μ½”λ“œμ™€ 검증 방식에 λŒ€ν•΄ μ΅œλŒ€ν•œ μžμ„Ένžˆ μž‘μ„±ν•΄ μ£Όμ„Έμš”! + validations: + required: true + - type: textarea + attributes: + label: βœ… μž‘μ—…ν•  λ‚΄μš© + description: ν•  일을 μ²΄ν¬λ°•μŠ€ ν˜•νƒœλ‘œ μž‘μ„±ν•΄μ£Όμ„Έμš”. + placeholder: μ΅œλŒ€ν•œ μ„ΈλΆ„ν™” ν•΄μ„œ μ μ–΄μ£Όμ„Έμš”! + validations: + required: true + - type: textarea + attributes: + label: πŸ™‹πŸ» μ°Έκ³  자료 + description: μ°Έκ³  μžλ£Œκ°€ μžˆλ‹€λ©΄ μž‘μ„±ν•΄ μ£Όμ„Έμš”. diff --git a/.github/workflows/auto-branch.yml b/.github/workflows/auto-branch.yml deleted file mode 100644 index 4634d2b..0000000 --- a/.github/workflows/auto-branch.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Create Issue Branch -on: - issues: - types: [ assigned ] - issue_comment: - types: [ created ] - pull_request: - types: [ closed ] - -jobs: - create_issue_branch_job: - runs-on: ubuntu-latest - steps: - - name: Create Issue Branch - uses: robvanderleek/create-issue-branch@main - env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} diff --git a/.github/workflows/close-issue.yml b/.github/workflows/close-issue.yml new file mode 100644 index 0000000..cd25d28 --- /dev/null +++ b/.github/workflows/close-issue.yml @@ -0,0 +1,14 @@ +name: Close Issue When PR Merged +on: + pull_request: + types: [closed] + +jobs: + close_issue: + runs-on: ubuntu-latest + steps: + - name: Close linked issue + uses: peter-evans/close-issue@v2 + with: + github_token: ${{ secrets.TOKEN }} + comment: "βœ… PR이 λ¨Έμ§€λ˜μ–΄ ν•΄λ‹Ή 이슈λ₯Ό λ‹«μŠ΅λ‹ˆλ‹€." diff --git a/.github/workflows/create-branch.yml b/.github/workflows/create-branch.yml new file mode 100644 index 0000000..443c204 --- /dev/null +++ b/.github/workflows/create-branch.yml @@ -0,0 +1,68 @@ +name: Create Issue Branch +on: + issues: + types: [assigned] + issue_comment: + types: [created] + pull_request: + types: [closed] + +jobs: + create_issue_branch_job: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Debug Git repository + run: | + git remote -v + git branch + git status + + - name: Determine Branch Name Based on Issue Labels + id: detect_branch + run: | + LABEL=$(echo '${{ toJSON(github.event.issue.labels) }}' | jq -r '.[0].name') + if [[ -z "$LABEL" || "$LABEL" == "null" ]]; then + LABEL="feature" # κΈ°λ³Έκ°’ μ„€μ • + fi + BRANCH_NAME="${LABEL}/issue-${{ github.event.issue.number }}" + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + echo "πŸ”Ή Detected branch name: $BRANCH_NAME" + + - name: Create Issue Branch + uses: robvanderleek/create-issue-branch@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + default-branch: dev + branch-name: "${{ env.BRANCH_NAME }}" + overwrite-existing: true + + - name: Check if PR already exists + id: check_pr + run: | + if gh pr list --state open --base dev --head "${{ env.BRANCH_NAME }}" --repo ${{ github.repository }} | grep "${{ env.BRANCH_NAME }}"; then + echo "pr_exists=true" >> $GITHUB_ENV + else + echo "pr_exists=false" >> $GITHUB_ENV + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Open Pull Request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: dev + branch: "${{ env.BRANCH_NAME }}" + title: "πŸš€ Pull Request #${{ github.event.issue.number }}" + body: | + πŸ”₯ **이슈 #${{ github.event.issue.number }}에 λŒ€ν•œ PR 생성!** πŸ”₯ + + - 이슈 링크: #${{ github.event.issue.number }} + delete-branch: false + allow-empty-commits: true diff --git a/.github/workflows/delete-branch.yml b/.github/workflows/delete-branch.yml new file mode 100644 index 0000000..ad1416a --- /dev/null +++ b/.github/workflows/delete-branch.yml @@ -0,0 +1,14 @@ +name: Delete Merged Branch +on: + pull_request: + types: [closed] + +jobs: + delete_merged_branch: + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true + steps: + - name: Delete branch if merged + uses: github-actions/delete-merged-branch@v4 + with: + github_token: ${{ secrets.TOKEN }}