Skip to content

Commit

Permalink
Merge pull request #134 from pbulsink/workflow-fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
SCasanova authored Jul 21, 2023
2 parents c9dfbdd + c5a266d commit 95a72ce
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

Expand Down
26 changes: 19 additions & 7 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
on:
push:
branches: [main, master]
workflow_dispatch:
pull_request:
branches: [main, master]

name: Style and Doc

permissions:
contents: write

jobs:
document:
name: document
Expand Down Expand Up @@ -53,14 +51,21 @@ jobs:
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: Changes Check
id: verify_diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: commit
if: steps.verify_diff.outputs.changed == 'true' && github.event_name == 'push'
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add man/\* NAMESPACE
git commit -m 'Document'
git commit -m 'GH Actions Document'
- uses: r-lib/actions/pr-push@v2
if: steps.verify_diff.outputs.changed == 'true' && github.event_name == 'push'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -86,13 +91,20 @@ jobs:
run: styler::style_pkg()
shell: Rscript {0}

- name: Changes Check
id: verify_diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: commit
if: steps.verify_diff.outputs.changed == 'true' && github.event_name == 'push'
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add \*.R
git commit -m 'Style'
git add \*.R \vignettes\*.Rmd README.Rmd
git commit -m 'GH Actions Style'
- uses: r-lib/actions/pr-push@v2
if: steps.verify_diff.outputs.changed == 'true' && github.event_name == 'push'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions R/load_schedule.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param season number from 1950 to current season (defaults to current season). `'current'` also accepted.
#' @importFrom magrittr "%>%"
#' @keywords internal
#' @return A tibble with one row per circuit in season
#' @return A tibble with one row per round in season. Indicates in sprint_date if a specific round has a sprint race
.load_schedule <- function(season = get_current_season()) {
if (season != "current" && (season < 1950 || season > get_current_season())) {
cli::cli_abort('{.var season} must be between 1950 and {get_current_season()} (or use "current")')
Expand Down Expand Up @@ -36,7 +36,7 @@
janitor::clean_names()
} else if (season < 2021) {
data$MRData$RaceTable$Races %>%
tidyr::unnest(cols = c("Circuit"), names_repair = "universal") %>%
tidyr::unnest(cols = c('Circuit'), names_repair = "universal") %>%
janitor::clean_names() %>%
suppressWarnings() %>%
suppressMessages() %>%
Expand Down Expand Up @@ -83,7 +83,7 @@
#' @inherit .load_schedule title description params return
#' @export
#' @examples
#' # Load this year's schedule:
#' # Load this year's schedule. Note the weekends which have sprints
#' load_schedule()
#'
#' # Load the schedule from 2008
Expand Down

0 comments on commit 95a72ce

Please sign in to comment.