aidanmelen / no-deploy-on-friday-action

This action aims to codify the unspoken rule of "No Deployments on Friday". This is achieved by simply terminating the action with a non-zero exit code when the date conditions are met.
0 stars 0 forks source link

TimeZone #1

Open onabison opened 1 month ago

onabison commented 1 month ago

Hi @aidanmelen aidanmelen

I hate to be the first one to report an issue. I hope you can resolve this quickly, seems like a simple fix.

This seems like a really cool action feature. I am trying to use it but I'm running into the issue below:


  File "/usr/local/lib/python3.9/zoneinfo/_common.py", line 12, in load_tzdata
    return importlib.resources.open_binary(package_name, resource_name)
  File "/usr/local/lib/python3.9/importlib/resources.py", line 88, in open_binary
    package = _get_package(package)
  File "/usr/local/lib/python3.9/importlib/resources.py", line 49, in _get_package
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
    module = _resolve(package)
  File "/usr/local/lib/python3.9/importlib/resources.py", line 40, in _resolve
    return import_module(name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tzdata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/main.py", line 49, in <module>
    main()
  File "/app/main.py", line [18](https://github.com/wcet-dope-aio/terraform-gcp-org/actions/runs/10356882440/job/28667711589#step:4:19), in main
    today, day_name = helpers.get_today_and_day_name()
  File "/app/helpers.py", line 28, in get_today_and_day_name
    today = datetime.datetime.now(ZoneInfo(inputs.TZ.upper()))
  File "/usr/local/lib/python3.9/zoneinfo/_common.py", line 24, in load_tzdata
    raise ZoneInfoNotFoundError(f"No time zone found with key {key}")
zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key PST'```
onabison commented 1 month ago

@aidanmelen

I realized the issue was due to the fact that I used a TimeZone that was not accepted by your script PST. I thought it was a very common TimeZone. Maybe you can update your code to accommodate that?

Thanks!