Skip to content

Commit

Permalink
removed binary conversion of github action token
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenpp7 committed Oct 18, 2024
1 parent b45b4a8 commit c876206
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions R/google_auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ google_auth <- function(email = NA) {
oauth_token_path <- ".config/gcloud/google-oauth-token.rds"

# Check if we are running in GitHub Actions by looking for the environment variable
if (Sys.getenv("GITHUB_ACTIONS") == "true") {
# Retrieve the Base64-encoded OAuth token from the environment (GitHub Secrets)
base64_token <- Sys.getenv("GOOGLE_OAUTH_TOKEN_BASE64")

# Decode the Base64 string and write it to a binary RDS file
decoded_token <- base64decode(base64_token)
writeBin(decoded_token, oauth_token_path)
}
# if (Sys.getenv("GITHUB_ACTIONS") == "true") {
# # Retrieve the Base64-encoded OAuth token from the environment (GitHub Secrets)
# base64_token <- Sys.getenv("GOOGLE_OAUTH_TOKEN_BASE64")
#
# # Decode the Base64 string and write it to a binary RDS file
# decoded_token <- base64decode(base64_token)
# writeBin(decoded_token, oauth_token_path)
# }

# Load the OAuth token from the RDS file and authenticate
if (file.exists(oauth_token_path)) {
Expand Down

0 comments on commit c876206

Please sign in to comment.