diff --git a/.github/workflows/upload-changesets.yml b/.github/workflows/upload-changesets.yml index 18bfb72..44e1072 100644 --- a/.github/workflows/upload-changesets.yml +++ b/.github/workflows/upload-changesets.yml @@ -4,9 +4,6 @@ on: types: - published -permissions: - contents: write - jobs: upload-changesets: name: Upload changesets @@ -33,10 +30,20 @@ jobs: cleanup-changesets: runs-on: ubuntu-latest needs: upload-changesets + environment: production steps: + - name: 'Get token for the GitHub App' + if: ${{ vars.APP_ID != '' }} + uses: actions/create-github-app-token@f2acddfb5195534d487896a656232b016a682f3c + id: app-token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + - uses: actions/checkout@v4 with: ref: main + token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }} - name: Remove changesets zip files run: rm .changeset/changesets-*.zip @@ -45,5 +52,5 @@ jobs: uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 with: add: '.' - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }} message: 'chore(skip-ci): remove changesets zip files'