Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/schedule-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
- name: Append JSONL to file
env:
SCHEDULE: ${{ steps.verify-inputs.outputs.schedule }}
JOB_ID: ${{ github.run_number }}
run: python3 .github/workflows/scripts/schedule_matchkeys.py -l info

- name: Show recent schedule
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/scripts/schedule_matchkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pathlib import Path
import sys

SCRIPT_VERSION = "1.0.1"
SCRIPT_VERSION = "1.0.2"

LOGLEVELS = {
"debug": logging.DEBUG,
Expand Down Expand Up @@ -54,17 +54,23 @@ def get_options():
except KeyError:
LOGGER.error("Missing env: SCHEDULE")
options_okay = False
try:
job_id = os.environ["JOB_ID"]
except KeyError:
LOGGER.error("Missing env: JOB_ID")
options_okay = False
schedule_pn = PROG_PATH.parent.parent.parent.joinpath("js/schedule-matchkeys.jsonl")
if not options_okay:
sys.exit(2)
return schedule, schedule_pn
return int(job_id), schedule, schedule_pn


def append_schedule(schedule, schedule_pn):
def append_schedule(job_id, schedule, schedule_pn):
"""
Composes the JSONL and appends to file.
"""
json_packet = {}
json_packet["id"] = job_id
json_packet["scheduleDate"] = (
datetime.now(timezone.utc).replace(microsecond=0).isoformat()
)
Expand All @@ -78,9 +84,9 @@ def main():
"""
Append the schedule JSONL to schedule-matchkeys.jsonl file.
"""
schedule, schedule_pn = get_options()
job_id, schedule, schedule_pn = get_options()
LOGGER.debug("schedule=%s schedule_pn=%s", schedule, schedule_pn)
append_schedule(schedule, schedule_pn)
append_schedule(job_id, schedule, schedule_pn)


if __name__ == "__main__":
Expand Down
3 changes: 1 addition & 2 deletions js/schedule-matchkeys.jsonl
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{"scheduleDate": "2026-07-28T07:33:40+00:00", "deployment": "goldrush2024:1163910:main,isxn:d88522c:main"}
{"scheduleDate": "2026-07-28T07:36:44+00:00", "deployment": "goldrush2024:5d8c6eb:main"}
{"id": 16, "scheduleDate": "2026-08-10T00:19:07+00:00", "deployment": "goldrush2024:1163910:remotes/origin/main,isxn:d88522c:remotes/origin/main"}