Skip to content

Commit

Permalink
#149: bug/event_gather_inputs - support default values for from and t…
Browse files Browse the repository at this point in the history
…o ISO datetime (#152)

* #149: Event Gather - support default values for from and to ISO datetimes

* #149: Event Gather - missing Jinja2 raw delimiters on interpolated variables
  • Loading branch information
gregoryfoster authored Dec 6, 2023
1 parent c911962 commit 84c13f2
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ on:
from:
description: "Optional ISO formatted string for datetime to begin event gather from."
required: false
default: "" # Will get converted to N (default 2) days prior
to:
description: "Optional ISO formatted string for datetime to end event gather at."
required: false
default: "" # Will get converted to now

permissions:
id-token: write
Expand Down Expand Up @@ -102,6 +100,12 @@ jobs:
if: {% raw %}${{ github.event_name == 'workflow_dispatch' }}{% endraw %}
run: |
cd python/
{% raw %}run_cdp_event_gather event-gather-config.json \
--from ${{ github.event.inputs.from }} \
--to ${{ github.event.inputs.to }}{% endraw %}
CDP_FROM_USER={% raw %}${{ github.event.inputs.from }}{% endraw %}
CDP_FROM_DEFAULT=$(date -Iseconds -d "2 days ago")
CDP_FROM=${CDP_FROM_USER:-$CDP_FROM_DEFAULT}
CDP_TO_USER={% raw %}${{ github.event.inputs.to }}{% endraw %}
CDP_TO_DEFAULT=$(date -Iseconds)
CDP_TO=${CDP_TO_USER:-$CDP_TO_DEFAULT}
run_cdp_event_gather event-gather-config.json \
--from $CDP_FROM \
--to $CDP_TO

0 comments on commit 84c13f2

Please sign in to comment.