Skip to content

Commit

Permalink
fix: just use max to do the automation (#58)
Browse files Browse the repository at this point in the history
* fix: just use max to do the automation

* remove space

* main -> master

* remove filtering on lables now

* don't get fancy about push
  • Loading branch information
fuziontech committed Aug 8, 2024
1 parent 28da26a commit 3972b32
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Bump Version

on:
merge_group:
push:
branches:
- master

jobs:
bump-version:
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit 3972b32

Please sign in to comment.