Skip to content

Commit

Permalink
release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kyu9341 committed Nov 2, 2023
1 parent 4010092 commit d5ab13a
Show file tree
Hide file tree
Showing 10 changed files with 39,664 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest",
"ecmaFeatures": {
"jsx": false
}
},
"env": {
"es6": true,
"node": true
},
"ignorePatterns": [
"node_modules/",
"dist/"
],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 모든 파일 무시
*.*

# .js .ts 파일은 무시하지 않음
!*.[jt]s
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 120,
"bracketSpacing": false,
"bracketSameLine": true,
"trailingComma": "all",
"arrowParens": "avoid",
"semi": true,
"tabWidth": 4
}
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# simple-labeler

PR 에 자동으로 Label 을 추가해주는 간단한 Github Actions

## Usage

1. 아래와 같이 `.github/workflows/simple-labeler.yml` 파일을 작성합니다:

```yml
name: Simple Labeler
on:
pull_request:
types: [opened, ready_for_review]
jobs:
simple-labeler:
runs-on: [ubuntu-latest]
steps:
- name: Label to PR
uses: naver/simple-labeler@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: "D-3"
duplicate: "D-*"
```
2. 원하는 이벤트를 `on` 에 명시합니다. 여기서는 PR 생성 시, Draft 에서 Open 상태로 전환 시 Label 을 추가합니다.
(참고로, Draft 생성 시에는 발생하지 않습니다.)
3. 해당 이벤트가 발생하면 GitHub Actions 가 자동으로 `labels`에 입력한 Label 을 추가합니다.

## Inputs

### `token`

**Required** GitHub에서 제공하는 토큰

### `labels`

**Required** 이벤트 발생 시 추가할 Label 목록. 콤마(,)로 구분

### `duplicate`

기존에 붙은 Label 중 이 패턴과 일치하는 것이 있다면 새 Label을 추가하지 않습니다. (glob 패턴 사용)

## License
```
Copyright (c) 2023-present NAVER Corp.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
15 changes: 15 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Simple Labeler"
description: "Automatically applies labels to a PR when it's created."
inputs:
token:
description: "GitHub token"
required: true
labels:
description: "List of labels to be applied when a PR is created, separated by commas."
required: true
duplicate:
description: "If existing labels match this pattern, new labels won't be added. (Uses glob pattern)"
required: false
runs:
using: "node16"
main: "dist/index.js"
Loading

0 comments on commit d5ab13a

Please sign in to comment.