From 40aa96568b47c6cce0b224944299960d50b01799 Mon Sep 17 00:00:00 2001 From: James Greenhill Date: Thu, 8 Aug 2024 12:23:51 -0700 Subject: [PATCH] fix: Use github token to checkout - hopefully setting the right permissions (#52) fix: Use github token to fix --- .github/workflows/bump-version.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index e20d52a..c43d812 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -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 @@ -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 @@ -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: |