Skip to content

Commit

Permalink
fix: Use github token to checkout - hopefully setting the right permi…
Browse files Browse the repository at this point in the history
…ssions (#52)

fix: Use github token to fix
  • Loading branch information
fuziontech committed Aug 8, 2024
1 parent 9234bd7 commit 40aa965
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: secrets.POSTHOG_BOT_GITHUB_TOKEN

- name: Set up Go
uses: actions/setup-go@v3
Expand All @@ -20,6 +21,8 @@ jobs:

- name: Determine version bump type
id: bump-type
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
echo "type=minor" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -51,14 +54,12 @@ 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 "action@github.com"
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: |
Expand Down

0 comments on commit 40aa965

Please sign in to comment.