Skip to content

Commit

Permalink
Update update-changelog.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Geun-Oh authored Jan 3, 2025
1 parent 865cc77 commit 9ab2b5a
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/update-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Update CHANGELOG with Release Notes
on:
release:
types:
- published # 새로운 릴리즈가 생성될 때 실행
- published

permissions:
contents: write # CHANGELOG.md 업데이트를 위해 권한 설정
contents: write

jobs:
update-changelog:
Expand All @@ -15,24 +15,18 @@ jobs:
steps:
# 1. 코드 체크아웃
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
uses: actions/checkout@v4

# 2. 릴리즈 정보 가져오기
- name: Get release information
id: release-info
uses: actions/github-script@v6
with:
script: |
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: context.payload.release.tag_name,
});
const release = context.payload.release;
return {
tag_name: release.data.tag_name,
body: release.data.body,
tag_name: release.tag_name || '',
body: release.body || 'No release notes provided.',
};
# 3. 기존 CHANGELOG.md 파일 업데이트
Expand All @@ -42,7 +36,7 @@ jobs:
echo "" >> new_changelog.md
echo "${{ steps.release-info.outputs.body }}" >> new_changelog.md
echo "" >> new_changelog.md
cat CHANGELOG.md >> new_changelog.md
cat CHANGELOG.md >> new_changelog.md || true
mv new_changelog.md CHANGELOG.md
# 4. GitHub Actions 봇 계정 설정 및 변경 사항 커밋
Expand Down

0 comments on commit 9ab2b5a

Please sign in to comment.