Skip to content

Commit

Permalink
Use token in spelling workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed Aug 18, 2023
1 parent 067d1af commit 86a717a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/spelling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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: |
Expand Down

0 comments on commit 86a717a

Please sign in to comment.