diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..6249416f --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,31 @@ +# docs 폴더 하위에 있는 파일이 변경되면 documentation 라벨을 붙인다. +documentation: + - changed-files: + - any-glob-to-any-file: "**/docs/**" + +# config 폴더 하위에 있는 파일이 변경되거나, 브랜치 이름이 config로 시작하면 config 라벨을 붙인다. +config: + - changed-files: + - any-glob-to-any-file: "**/config/**" + - head-branch: ["^config", "config"] + +# scripts 폴더 하위에 있는 파일이 변경되면 script 라벨을 붙인다. +script: + - changed-files: + - any-glob-to-any-file: "**/scripts/**" + +# 브랜치 이름이 feat 또는 feature로 시작하면 feature 라벨을 붙인다. +feature: + - head-branch: ["^feat", "feat", "^feature", "feature"] + +# 브랜치 이름이 refactor로 시작하면 refactor 라벨을 붙인다. +refactor: + - head-branch: ["^refactor", "refactor"] + +# 브랜치 이름이 fix로 시작하면 fix 라벨을 붙인다. +fix: + - head-branch: ["^fix", "fix"] + +# 브랜치 이름이 test로 시작하면 test 라벨을 붙인다. +test: + - head-branch: ["^test", "test"] diff --git a/.github/workflows/auto-assign-author-to-assigness.yml b/.github/workflows/auto-assign-author-to-assigness.yml new file mode 100644 index 00000000..5c209ed6 --- /dev/null +++ b/.github/workflows/auto-assign-author-to-assigness.yml @@ -0,0 +1,26 @@ +name: auto assign author to assignees + +on: + pull_request: + types: [opened] + +jobs: + add-assignees: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Add assignee + uses: actions/github-script@v3 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.addAssignees({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + assignees: [context.payload.pull_request.user.login] + }) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 6249416f..cae873a0 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,31 +1,18 @@ -# docs 폴더 하위에 있는 파일이 변경되면 documentation 라벨을 붙인다. -documentation: - - changed-files: - - any-glob-to-any-file: "**/docs/**" +name: "auto assign label to pull request" -# config 폴더 하위에 있는 파일이 변경되거나, 브랜치 이름이 config로 시작하면 config 라벨을 붙인다. -config: - - changed-files: - - any-glob-to-any-file: "**/config/**" - - head-branch: ["^config", "config"] +on: + - pull_request_target -# scripts 폴더 하위에 있는 파일이 변경되면 script 라벨을 붙인다. -script: - - changed-files: - - any-glob-to-any-file: "**/scripts/**" +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 -# 브랜치 이름이 feat 또는 feature로 시작하면 feature 라벨을 붙인다. -feature: - - head-branch: ["^feat", "feat", "^feature", "feature"] - -# 브랜치 이름이 refactor로 시작하면 refactor 라벨을 붙인다. -refactor: - - head-branch: ["^refactor", "refactor"] - -# 브랜치 이름이 fix로 시작하면 fix 라벨을 붙인다. -fix: - - head-branch: ["^fix", "fix"] - -# 브랜치 이름이 test로 시작하면 test 라벨을 붙인다. -test: - - head-branch: ["^test", "test"] + - uses: actions/labeler@v5 + with: + repo-token: ${{secrets.GITHUB_TOKEN}} + configuration-path: .github/labeler.yml