Skip to content

Commit

Permalink
new setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb committed Sep 10, 2024
1 parent 7257fb5 commit e5d7f90
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/update_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
workflow_dispatch:
inputs:
season_rebuild:
description: 'Rebuild Season (9999 defaults to latest season)'
description: 'Rebuild Season (9999 defaults to latest season). Do multiple seasons comma separated, e.g. 2017,2019,2021'
required: false
default: 9999
type: number
Expand All @@ -37,17 +37,26 @@ jobs:
outputs:
seasons: ${{ steps.query_seasons.outputs.seasons }}
steps:
- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: nflverse/nflverse-workflows

- id: query_seasons
name: Query Seasons
run: |
if [ $FULL_REBUILD == true ]
then
echo "seasons=$(gh release list -R nflverse/nflverse-pbp --json tagName --jq '[.[].tagName | match("\\d+") | .string ]')" > "$GITHUB_OUTPUT"
seasons=$( Rscript -e 'nflverse.workflows::get_season_range(1999)' )
elif [ $SEASON_REBUILD == 9999 ]
then
echo "seasons=$(gh release list -R nflverse/nflverse-pbp --json tagName --jq '[[.[].tagName | match("\\d+") | .string ] | max]')" > "$GITHUB_OUTPUT"
seasons=$( Rscript -e 'nflverse.workflows::get_current_season()' )
else
echo "seasons=$(gh release list -R nflverse/nflverse-pbp --json tagName --jq '[.[].tagName | select(endswith(${{ env.SEASON_REBUILD }} | tostring)) | match("\\d+") | .string]')" > "$GITHUB_OUTPUT"
seasons="[$SEASON_REBUILD]"
fi
echo "seasons=$seasons" >> "$GITHUB_OUTPUT"
update_pbp:
needs: pbp_setup
Expand Down

0 comments on commit e5d7f90

Please sign in to comment.