From 8d8947ea7972a1339a12e15aae91a0aca6f5a77a Mon Sep 17 00:00:00 2001 From: James Greenhill Date: Thu, 8 Aug 2024 15:19:37 -0700 Subject: [PATCH] fix: add merge queue to avoid pushing to master entirely --- .github/workflows/bump-version.yml | 8 +++----- .github/workflows/unit-tests.yml | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index d5454d2..a810273 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -1,9 +1,7 @@ name: Bump Version on: - push: - branches: - - master + - merge_group jobs: bump-version: @@ -24,7 +22,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} run: | - pr_number=$(gh pr list --base master --state merged --limit 1 --json number --jq '.[0].number') + pr_number=$(jq --raw-output .number "$GITHUB_EVENT_PATH") if [[ $(gh pr view $pr_number --json labels -q '.labels[].name' | grep -q "minor") ]]; then echo "type=minor" >> $GITHUB_OUTPUT else @@ -64,7 +62,7 @@ jobs: git config --local user.name "GitHub Action" git add version.go CHANGELOG.md git commit -m "Bump version to ${{ steps.bump-version.outputs.new_version }}" - git push https://$PAT@github.com/${{ github.repository }}.git HEAD:master + git push - name: Create tag run: | diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 6a2f55b..5cdce9e 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,7 +1,8 @@ name: Unit Tests -on: - - pull_request +on: + pull_request: + merge_group: jobs: build: