diff --git a/.github/workflows/update_data.yaml b/.github/workflows/update_data.yaml index 904d5aaf8..678e13b9d 100644 --- a/.github/workflows/update_data.yaml +++ b/.github/workflows/update_data.yaml @@ -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 @@ -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: