From 86a717af6a98720d6cdd0278040ae11845acd526 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Fri, 18 Aug 2023 11:03:51 +0200 Subject: [PATCH] Use token in spelling workflow --- .github/workflows/spelling.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/spelling.yaml b/.github/workflows/spelling.yaml index cc476a0e..d5d95996 100644 --- a/.github/workflows/spelling.yaml +++ b/.github/workflows/spelling.yaml @@ -15,6 +15,10 @@ on: - main workflow_dispatch: workflow_call: + secrets: + REPO_GITHUB_TOKEN: + description: Github token with write access to the repo + required: false inputs: package-subdirectory: description: Subdirectory in the repository, where the R package is located. @@ -37,8 +41,22 @@ jobs: image: ghcr.io/insightsengineering/rstudio_4.3.1_bioc_3.17:latest steps: + - name: Setup token 🔑 + id: github-token + run: | + if [ "${{ secrets.REPO_GITHUB_TOKEN }}" == "" ]; then + echo "REPO_GITHUB_TOKEN is empty. Substituting it with GITHUB_TOKEN." + echo "token=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_OUTPUT + else + echo "Using REPO_GITHUB_TOKEN." + echo "token=${{ secrets.REPO_GITHUB_TOKEN }}" >> $GITHUB_OUTPUT + fi + shell: bash + - name: Checkout Code 🛎 uses: actions/checkout@v3 + with: + token: ${{ steps.github-token.outputs.token }} - name: Normalize variables 📏 run: |