Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes: more fixes for the auto version bumper #54

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
persist-credential: false

- name: Set up Go
uses: actions/setup-go@v3
Expand All @@ -24,7 +24,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
run: |
if [[ $(gh pr view ${{ github.event.pull_request.number }} --json labels -q '.labels[].name' | grep -q "minor") ]]; then
pr_number=$(gh pr list --base master --state merged --limit 1 --json number --jq '.[0].number')
if [[ $(gh pr view $pr_number --json labels -q '.labels[].name' | grep -q "minor") ]]; then
echo "type=minor" >> $GITHUB_OUTPUT
else
echo "type=patch" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -56,12 +57,14 @@ jobs:
echo -e "## $new_version\n\n* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v${current_version}...v${new_version})\n\n$(cat CHANGELOG.md)" > CHANGELOG.md

- name: Commit and push changes
env:
PAT: ${{ secrets.PAT_WITH_PUSH_ACCESS }}
run: |
git config --local user.email "[email protected]"
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
git push https://[email protected]/${{ github.repository }}.git HEAD:master

- name: Create tag
run: |
Expand Down
Loading