Skip to content

Commit

Permalink
set inputs as env vars
Browse files Browse the repository at this point in the history
with defaults to work with scheduled workflows
  • Loading branch information
mrcaseb committed Mar 1, 2024
1 parent add8844 commit ccc9cfe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/update_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
default: 9999
type: number
full_rebuild:
description: 'Full Rebuild'
description: 'Full Rebuild (overwrites above season)'
required: true
default: false
type: boolean
Expand All @@ -32,19 +32,21 @@ jobs:
name: pbp_setup
env:
GH_TOKEN: ${{ secrets.NFLVERSE_GH_TOKEN }}
FULL_REBUILD: ${{ inputs.full_rebuild || false }}
SEASON_REBUILD: ${{ inputs.season_rebuild || 9999 }}
outputs:
seasons: ${{ steps.query_seasons.outputs.seasons }}
steps:
- id: query_seasons
run: |
if [ ${{ inputs.full_rebuild }} == true ]
if [ ${FULL_REBUILD} == true ]
then
echo "seasons=$(gh release list -R nflverse/nflverse-pbp --json tagName --jq '[.[].tagName | match("\\d+") | .string ]')" > "$GITHUB_OUTPUT"
elif [ ${{ inputs.season_rebuild }} == 9999 ]
elif [ ${SEASON_REBUILD} == 9999 ]
then
echo "seasons=$(gh release list -R nflverse/nflverse-pbp --json tagName --jq '[[.[].tagName | match("\\d+") | .string ] | max]')" > "$GITHUB_OUTPUT"
else
echo "seasons=$(gh release list -R nflverse/nflverse-pbp --json tagName --jq '[.[].tagName | select(endswith(${{ inputs.season_rebuild }} | tostring)) | match("\\d+") | .string]')" > "$GITHUB_OUTPUT"
echo "seasons=$(gh release list -R nflverse/nflverse-pbp --json tagName --jq '[.[].tagName | select(endswith(${SEASON_REBUILD} | tostring)) | match("\\d+") | .string]')" > "$GITHUB_OUTPUT"
fi
update_pbp:
Expand Down

0 comments on commit ccc9cfe

Please sign in to comment.