From d9bccc94f820d2d82c186cb2dae1e2565a305c63 Mon Sep 17 00:00:00 2001 From: Nathan Totten Date: Fri, 4 Oct 2024 13:52:45 -0400 Subject: [PATCH] Use labels for changelogs (#246) --- .github/release.yaml | 18 ++++++++++++++++++ .github/workflows/main.yaml | 24 +++++++++++++++++++----- 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 .github/release.yaml diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 00000000..91463990 --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,18 @@ +changelog: + categories: + - title: Breaking Changes 🛠 + labels: + - breaking-change + - deprecation + - title: New Features 🎉 + labels: + - feature + - title: Bug Fixes 🐛 + labels: + - bug + - title: Documentation 📚 + labels: + - docs + - title: Other Changes 🔄 + labels: + - "*" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0a83331c..c8b4e155 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -35,6 +35,7 @@ jobs: actions: read contents: write id-token: write + pull-requests: read # This can only be triggered from main if: github.ref == 'refs/heads/main' @@ -93,11 +94,24 @@ jobs: if: github.event_name == 'workflow_dispatch' run: git push origin main --follow-tags - - name: Changelog - if: github.event_name == 'workflow_dispatch' - run: nx release changelog ${{ env.ZUDOKU_VERSION }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/github-script@v7 + name: Create Release + id: create-release + with: + result-encoding: string + retries: 3 + script: | + github.request("POST /repos/{owner}/{repo}/releases", { + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: `v${{ env.ZUDOKU_VERSION }}`, + draft: false, + prerelease: false, + generate_release_notes: true, + headers: { + "X-GitHub-Api-Version": "2022-11-28", + }, + }); - name: Authenticate to Google Cloud uses: google-github-actions/auth@v2