From f479184e0eaddb6a0de013a99e292ff90f9118d3 Mon Sep 17 00:00:00 2001 From: Jane Chu <7559015+janechu@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:39:01 -0700 Subject: [PATCH] Added tokens for github pages workflow (#6993) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Pull Request ## 📖 Description The repository does not have permissions to add commits to a branch on GitHub, this adds to the github pages deploy workflow the same tokens used for npm package publishing which must perform a similar action and so should work. ## 👩‍💻 Reviewer Notes Initial attempt at manually running the workflow ended in a `403`, in theory this change should grant the permissions needed to apply commits to the `gh-pages` branch. ## ✅ Checklist ### General - [ ] I have included a change request file using `$ yarn change` - [ ] I have added tests for my changes. - [ ] I have tested my changes. - [ ] I have updated the project documentation to reflect my changes. - [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/master/CONTRIBUTING.md) documentation and followed the [standards](https://github.com/microsoft/fast/blob/master/CODE_OF_CONDUCT.md#our-standards) for this project. --- .github/workflows/cd-gh-pages.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/cd-gh-pages.yml b/.github/workflows/cd-gh-pages.yml index b37d0cf3a1d..b64a5d353f3 100644 --- a/.github/workflows/cd-gh-pages.yml +++ b/.github/workflows/cd-gh-pages.yml @@ -3,6 +3,10 @@ name: Deploy GitHub Pages on: workflow_dispatch: +env: + GITHUB_SERVICE_USER: "Microsoft FAST Builds" + GITHUB_SERVICE_EMAIL: "fastsvc@microsoft.com" + jobs: build: runs-on: ubuntu-latest @@ -14,6 +18,12 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 + token: ${{ secrets.GH_TOKEN }} + + - name: Set Git User + run: | + git config --global user.name "${{ env.GITHUB_SERVICE_USER }}" + git config --global user.email "${{ env.GITHUB_SERVICE_EMAIL }}" - name: Get yarn cache directory path id: yarn-cache-dir-path