Skip to content

Commit 464e376

Browse files
committed
[#19] Update README.md
1 parent 75c8e27 commit 464e376

File tree

2 files changed

+113
-2
lines changed

2 files changed

+113
-2
lines changed

canary-publish/README.ko.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,65 @@ jobs:
5050
version_template: '{VERSION}-canary.{DATE}-{COMMITID7}' # (선택) Canary 버전명 템플릿
5151
dry_run: false # (선택) true면 실제 배포 없이 시뮬레이션만 수행
5252
language: 'en' # (선택) 메시지 언어 설정 (en, ko 등)
53-
create_release: false # (선택) true면 Canary 배포 후 GitHub Release 자동 생성. 반드시 @action/checkout에 `fetch-depth: 0` with 옵션을 주세요.
53+
create_release: false # (선택) true면 Canary 배포 후 GitHub Release 자동 생성
5454
```
5555
56+
### ⚠️ `create_release: true` 사용 시 주의사항
57+
58+
이 액션을 `create_release: true` 옵션과 함께 사용할 때는 아래 사항을 반드시 지켜주세요.
59+
60+
1. `actions/checkout`의 `fetch-depth: 0` 설정
61+
62+
전체 git 히스토리를 받아와야 릴리즈 노트가 정확하게 생성됩니다.
63+
64+
```yml
65+
- uses: actions/checkout@v4
66+
with:
67+
fetch-depth: 0
68+
```
69+
70+
2. `GH_TOKEN` 환경 변수 설정
71+
72+
gh CLI 사용을 위해 인증 토큰이 필요합니다. 아래와 같이 환경 변수로 지정해 주세요.
73+
74+
```yml
75+
env:
76+
GH_TOKEN: ${{ github.token }}
77+
```
78+
79+
(job 또는 workflow 전체에 지정해도 됩니다.)
80+
81+
3. `permissions: contents: write` 권한 추가
82+
83+
릴리즈 생성을 위해 해당 권한이 필요합니다.
84+
85+
```yml
86+
permissions:
87+
contents: write
88+
```
89+
90+
예시 워크플로우
91+
92+
```yml
93+
permissions:
94+
contents: write
95+
96+
jobs:
97+
release:
98+
env:
99+
GH_TOKEN: ${{ github.token }}
100+
steps:
101+
- uses: actions/checkout@v4
102+
with:
103+
fetch-depth: 0
104+
- uses: NaverPayDev/changeset-actions/canary-publish@main
105+
with:
106+
create_release: true
107+
```
108+
109+
**위 설정이 누락되면 릴리즈 생성이 실패할 수 있습니다. 반드시 확인해 주세요!**
110+
111+
56112
## 실행 결과
57113

58114
![example](./src/assets/example.png)

canary-publish/README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,64 @@ jobs:
5050
version_template: '{VERSION}-canary.{DATE}-{COMMITID7}' # (Optional) Template for the canary version string.
5151
dry_run: false # (Optional) If true, performs a dry run without publishing.
5252
language: 'en' # (Optional) Language for output messages (e.g., en, ko).
53-
create_release: false # (Optional) If true, creates a GitHub Release after canary publishing. Make sure to add `fetch-depth: 0` `with` option to @action/checkout.
53+
create_release: false # (Optional) If true, creates a GitHub Release after canary publishing.
5454
```
5555
56+
### ⚠️ Important Notes for `create_release: true`
57+
58+
When using this action with `create_release: true`, please make sure to:
59+
60+
1. Set `fetch-depth: 0` for `actions/checkout`
61+
62+
This ensures the full git history is available for generating release notes.
63+
64+
```yml
65+
- uses: actions/checkout@v4
66+
with:
67+
fetch-depth: 0
68+
```
69+
70+
2. Set the `GH_TOKEN` environment variable
71+
72+
The gh CLI requires authentication. Set the token as an environment variable:
73+
74+
```yml
75+
env:
76+
GH_TOKEN: ${{ github.token }}
77+
```
78+
79+
Or at the job/workflow level.
80+
81+
3. Add `permissions: contents: write` to your workflow
82+
83+
This is required for creating releases via the GitHub API.
84+
85+
```yml
86+
permissions:
87+
contents: write
88+
```
89+
90+
Example Workflow Snippet
91+
92+
```yml
93+
permissions:
94+
contents: write
95+
96+
jobs:
97+
release:
98+
env:
99+
GH_TOKEN: ${{ github.token }}
100+
steps:
101+
- uses: actions/checkout@v4
102+
with:
103+
fetch-depth: 0
104+
- uses: NaverPayDev/changeset-actions/canary-publish@main
105+
with:
106+
create_release: true
107+
```
108+
109+
**If any of these are missing, the release creation step may fail.**
110+
56111
## Execution Results
57112

58113
![example](./src/assets/example.png)

0 commit comments

Comments
 (0)