From 02d0680a3f8c3ffe0b0d609a1b714b676501d59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gunnar=20Inge=20Gj=C3=B8vik=20Sortland?= Date: Wed, 4 Sep 2024 15:08:07 +0200 Subject: [PATCH] [github-actions] Automatic tag --- .github/workflows/automatic-release.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index cefeaee..18313a8 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -1,16 +1,16 @@ name: Automatic Release on Push on: - push: - tags: - - '*' + pull_request: + types: + - closed jobs: automatic-release: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest permissions: - contents: read - packages: write + contents: write steps: - name: Check out repository @@ -36,13 +36,17 @@ jobs: yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' gen/openapi.yaml templates/openapi.base.yaml > openapi.yaml - name: Push to Buf Schema Registry - if: startsWith(github.ref, 'refs/tags/') run: buf push + - name: Bump version and push tag + uses: anothrNick/github-tag-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') with: + token: ${{ secrets.GITHUB_TOKEN }} make_latest: true body: | Automatic release of the OpenAPI spec and the Buf image