From 64965fa51023623b268ec64dc4aa9a442431a71a Mon Sep 17 00:00:00 2001 From: Ed Stephinson Date: Thu, 20 Oct 2022 09:27:11 +0100 Subject: [PATCH] fix: use generated token for sanity to github plugin sync --- .github/workflows/sync-cms-to-repo.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sync-cms-to-repo.yml b/.github/workflows/sync-cms-to-repo.yml index 7b21611df..682bb5d25 100644 --- a/.github/workflows/sync-cms-to-repo.yml +++ b/.github/workflows/sync-cms-to-repo.yml @@ -3,8 +3,6 @@ on: repository_dispatch: # sync_cms_to_repo is a bespoke type created for use with the CMS Webhook types: [sync_cms_to_repo] -env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: sync-to-repo: runs-on: ubuntu-latest @@ -19,13 +17,15 @@ jobs: check-latest: true - name: Install dependencies run: npm install - - name: Setup git config - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' + - name: Generate GitHub token + uses: navikt/github-app-token-generator@v1.1.1 + id: get-token + with: + private-key: ${{ secrets.TOKENS_PRIVATE_KEY }} + app-id: ${{ secrets.TOKENS_APP_ID }} - name: Sync CMS to repo env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.get-token.outputs.token }} CMS_CHANGES: ${{ toJson(github.event.client_payload) }} run: bin/sync_cms_to_repo.sh