Skip to content

Commit 84c13f2

Browse files
#149: bug/event_gather_inputs - support default values for from and to 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
1 parent c911962 commit 84c13f2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

{{ cookiecutter.hosting_github_repo_name }}/.github/workflows/event-gather-pipeline.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ on:
1010
from:
1111
description: "Optional ISO formatted string for datetime to begin event gather from."
1212
required: false
13-
default: "" # Will get converted to N (default 2) days prior
1413
to:
1514
description: "Optional ISO formatted string for datetime to end event gather at."
1615
required: false
17-
default: "" # Will get converted to now
1816

1917
permissions:
2018
id-token: write
@@ -102,6 +100,12 @@ jobs:
102100
if: {% raw %}${{ github.event_name == 'workflow_dispatch' }}{% endraw %}
103101
run: |
104102
cd python/
105-
{% raw %}run_cdp_event_gather event-gather-config.json \
106-
--from ${{ github.event.inputs.from }} \
107-
--to ${{ github.event.inputs.to }}{% endraw %}
103+
CDP_FROM_USER={% raw %}${{ github.event.inputs.from }}{% endraw %}
104+
CDP_FROM_DEFAULT=$(date -Iseconds -d "2 days ago")
105+
CDP_FROM=${CDP_FROM_USER:-$CDP_FROM_DEFAULT}
106+
CDP_TO_USER={% raw %}${{ github.event.inputs.to }}{% endraw %}
107+
CDP_TO_DEFAULT=$(date -Iseconds)
108+
CDP_TO=${CDP_TO_USER:-$CDP_TO_DEFAULT}
109+
run_cdp_event_gather event-gather-config.json \
110+
--from $CDP_FROM \
111+
--to $CDP_TO

0 commit comments

Comments
 (0)