[Release] v1.2.0 λ²μ release #1
This file contains hidden or 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 Drafter | |
| on: | |
| push: | |
| branches: | |
| - main # mainμ λ¨Έμ§λλ©΄ β λ¦΄λ¦¬μ¦ μμ± | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| branches: | |
| - main # main λμ PRμ΄ μ΄λ¦΄ λ β μ΄μ μ λ°μ΄νΈ | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update_release_draft: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: release-drafter/release-drafter@v7 | |
| with: | |
| publish: ${{ github.event_name == 'push' }} # push(λ¨Έμ§)μμλ§ μ€μ publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| fill_pr_body: | |
| needs: update_release_draft # release drafter νλ‘μ° μλ£ ν μ€ν | |
| if: github.event_name == 'pull_request' && github.event.action == 'opened' && github.head_ref == 'develop' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get draft release and fill PR body | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const releases = await github.rest.repos.listReleases({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| }); | |
| const draft = releases.data.find(r => r.draft); | |
| if (!draft?.body) return; | |
| const changesOnly = draft.body.split('**Full Changelog**')[0].trim(); | |
| await github.rest.pulls.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.payload.pull_request.number, | |
| body: changesOnly, | |
| }); | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |