From 3972b32e9f421846959a5dcee8bb22f13af94d4f Mon Sep 17 00:00:00 2001 From: James Greenhill Date: Thu, 8 Aug 2024 16:22:46 -0700 Subject: [PATCH] fix: just use max to do the automation (#58) * fix: just use max to do the automation * remove space * main -> master * remove filtering on lables now * don't get fancy about push --- .github/workflows/bump-version.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 1fe252e..198c9af 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -1,7 +1,9 @@ name: Bump Version on: - merge_group: + push: + branches: + - master jobs: bump-version: @@ -10,19 +12,20 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - persist-credential: false - - name: Set up Go - uses: actions/setup-go@v3 + - name: Generate token + id: generate_token + uses: tibdex/github-app-token@v1 with: - go-version: '1.x' + app_id: ${{ secrets.MAX_APP_ID }} + private_key: ${{ secrets.MAX_PRIVATE_KEY }} - name: Determine version bump type id: bump-type env: GITHUB_TOKEN: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} run: | - pr_number=$(jq --raw-output .number "$GITHUB_EVENT_PATH") + pr_number=$(gh pr list --state merged --json number --limit 1 -q '.[0].number') if [[ $(gh pr view $pr_number --json labels -q '.labels[].name' | grep -q "minor") ]]; then echo "type=minor" >> $GITHUB_OUTPUT else @@ -58,11 +61,11 @@ jobs: env: PAT: ${{ secrets.PAT_WITH_PUSH_ACCESS }} run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" + git config --local user.email "max@posthog.com" + git config --local user.name "Max Hedgehog" git add version.go CHANGELOG.md git commit -m "Bump version to ${{ steps.bump-version.outputs.new_version }}" - git push + git push https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/${{ github.repository }}.git HEAD:master - name: Create tag run: |