cng #18
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Notes | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
generate-release-notes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/[email protected] | |
- name: Get Pull Requests | |
id: get_prs | |
run: | | |
PRS=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
"https://api.github.com/repos/${{ github.repository }}/pulls?state=closed" | \ | |
jq -r '.[] | select(.merged_at != null) | "- [\(.title)](\(.html_url))"') | |
echo "pr_list<<EOF" >> $GITHUB_ENV | |
echo "$PRS" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Generate Release Notes | |
run: | | |
echo "## What's Changed" > release-notes.md | |
echo "" >> release-notes.md | |
echo "${{ steps.get_prs.outputs.pr_list }}" >> release-notes.md # 환경 변수 사용 | |
echo "" >> release-notes.md | |
echo "(************)" | |
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ github.ref_name }}...${{ github.ref_name }}" >> release-notes.md | |
cat release-notes.md | |
echo "(************)" | |
- name: Publish Release Notes | |
uses: softprops/action-gh-release@v2 # 최신 버전으로 업데이트 | |
with: | |
tag_name: ${{ github.ref_name }} # refs/tags/ 없이 태그 이름만 사용 | |
name: 'Release ${{ github.ref_name }}' | |
body: | | |
$(cat release-notes.md) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |