Skip to content

Commit

Permalink
Merge pull request #239 from Sage-Bionetworks/add-branch-env-variable
Browse files Browse the repository at this point in the history
add branch name to renviron
  • Loading branch information
lakikowolfe authored Mar 6, 2024
2 parents eb62a96 + 9d12ef1 commit 9ed626d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/shinyapps_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
echo 'DFA_CLIENT_SECRET="${{ secrets.OAUTH_CLIENT_SECRET }}"' >> .Renviron
echo 'DFA_DCC_CONFIG="https://raw.githubusercontent.com/Sage-Bionetworks/data_flow_config/dev/tenants.json"' >> .Renviron
echo 'GITHUB_PAT="${{ secrets.GITHUB_TOKEN }}"' >> .Renviron
echo 'DFA_REF="${{ github.ref }}"' >> .Renviron
# deploy app using rsconnect
- name: Authorize and deploy app
Expand Down
18 changes: 12 additions & 6 deletions R/global.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## SET GLOBAL VARS

# READ IN BRANCH NAME
ref <- Sys.getenv("DFA_REF")

# SET FAVICON URL
FAVICON_URL <- file.path(
"https://raw.githubusercontent.com/Sage-Bionetworks/data_flow",
ref, # FIXME: Automate branch via env variable
"inst/app/www/favicon.ico"
)

# READ IN TENANTS.JSON
tenants_config_path <- Sys.getenv("DFA_DCC_CONFIG")
if (is.null(tenants_config_path) || nchar(tenants_config_path) == 0) stop("missing DFA_DCC_CONFIG environmental variable")
Expand Down Expand Up @@ -64,9 +76,3 @@ api <- httr::oauth_endpoint(

# The 'openid' scope is required by the protocol for retrieving user information.
scope <- "openid view download modify"

FAVICON_URL <- file.path(
"https://raw.githubusercontent.com/Sage-Bionetworks/data_flow",
"dev", # FIXME: Automate branch via env variable
"inst/app/www/favicon.ico"
)

0 comments on commit 9ed626d

Please sign in to comment.