Skip to content

Commit

Permalink
feat: add support for github token
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed Aug 14, 2024
1 parent bc12b80 commit cbba939
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ name: R-hub 🌐

on:
workflow_call:
secrets:
REPO_GITHUB_TOKEN:
description: |
Github token with read access to repositories
required: false
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
Expand Down Expand Up @@ -71,6 +76,18 @@ jobs:
image: ${{ matrix.config.container }}

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

- uses: r-hub/actions/checkout@v1

- uses: r-hub/actions/platform-info@v1
Expand All @@ -91,6 +108,8 @@ jobs:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
needs: DepsDev,DepsBranch
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}

- uses: r-hub/actions/run-check@v1
with:
Expand Down

0 comments on commit cbba939

Please sign in to comment.