Skip to content

Commit

Permalink
Update create release action [no version bump] (#113)
Browse files Browse the repository at this point in the history
* Update create release action [no version bump]

* Stop if no new data [no version bump]
  • Loading branch information
gmyenni authored Jan 30, 2024
1 parent 67c2c5b commit 3b774f0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
- name: Create Release
if: github.event_name != 'pull_request' && steps.version.outputs.new_ver == 'TRUE'
id: create_release
uses: zendesk/action-create-release@v1
uses: zendesk/action-create-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
10 changes: 10 additions & 0 deletions DataCleaningScripts/get_water_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ source("DataCleaningScripts/eden_covariates.R")
get_eden_data <- function() {

download_eden_depths()

if(length(list.files("Water", pattern = "*_depth.nc"))==0) {
return(NULL)
} else {

covariate_data <- read.table("Water/eden_covariates.csv", header = TRUE, sep = ",")
new_covariates <- get_eden_covariates() %>%
Expand Down Expand Up @@ -39,6 +43,7 @@ depth_data <- dplyr::filter(depth_data, !date %in% new_depths$date) %>%
file.remove(dir(path=file.path('Water'), pattern="_.*_depth.nc", full.names = TRUE))

update_last_download(metadata = get_metadata())
}

return(list(covariate_data=covariate_data, depth_data=depth_data))
}
Expand All @@ -50,12 +55,17 @@ return(list(covariate_data=covariate_data, depth_data=depth_data))
update_water <- function() {

data <- get_eden_data()

if(is.null(data)) {
return(cat("...No new data..."))
} else {

write.table(data$covariate_data, "Water/eden_covariates.csv", row.names = FALSE, col.names = TRUE,
na="", sep = ",", quote = FALSE)

write.table(data$depth_data, file = "Water/eden_depth.csv",
row.names = FALSE, col.names = TRUE, na = "", sep = ",", quote = FALSE)
}
}

#' Reads downloaded sophia.usgs gauge files
Expand Down

0 comments on commit 3b774f0

Please sign in to comment.