actions / upload-artifact

MIT License
3.26k stars 739 forks source link

[bug] created_at and updated_at are in different time zones #488

Closed nedbat closed 11 months ago

nedbat commented 11 months ago

What happened?

Using actions/upload-artifact, I get artifacts with created_at and updated_at in different time zones, but both with a Z suffix.

The action run: https://github.com/nedbat/coveragepy/actions/runs/7276115944/job/19825271579, step Upload coverage data:

Wed, 20 Dec 2023 13:58:59 GMT
Run actions/upload-artifact@v4
Wed, 20 Dec 2023 13:59:00 GMT With the provided path, there will be 1 file uploaded
Wed, 20 Dec 2023 13:59:00 GMT Artifact name is valid!
Wed, 20 Dec 2023 13:59:00 GMT Root directory input is valid!
Wed, 20 Dec 2023 13:59:00 GMT Beginning upload of artifact content to blob storage
Wed, 20 Dec 2023 13:59:00 GMT Uploaded bytes 751672
Wed, 20 Dec 2023 13:59:00 GMT Finished uploading artifact content to blob storage!
Wed, 20 Dec 2023 13:59:00 GMT SHA256 hash of uploaded artifact zip is bcf2293cbf1514ecb4cd517d8a9bba72e99a4feec74bd138c73a21e9d6520c78
Wed, 20 Dec 2023 13:59:00 GMT Finalizing artifact upload
Wed, 20 Dec 2023 13:59:00 GMT Artifact metacov-3.8.macos.zip successfully finalized. Artifact ID 1126633113
Wed, 20 Dec 2023 13:59:00 GMT Artifact metacov-3.8.macos has been successfully uploaded! Final size is 751672 bytes. Artifact ID is 1126633113

The resulting artifact from the REST API:

    {
      "id": 1126633113,
      "node_id": "MDg6QXJ0aWZhY3QxMTI2NjMzMTEz",
      "name": "metacov-3.8.macos",
      "size_in_bytes": 751672,
      "url": "https://api.github.com/repos/nedbat/coveragepy/actions/artifacts/1126633113",
      "archive_download_url": "https://api.github.com/repos/nedbat/coveragepy/actions/artifacts/1126633113/zip",
      "expired": false,
      "created_at": "2023-12-20T05:59:00Z",
      "updated_at": "2023-12-20T13:59:00Z",
      "expires_at": "2024-03-19T13:32:46Z",
      "workflow_run": {
        "id": 7276115944,
        "repository_id": 138421996,
        "head_repository_id": 138421996,
        "head_branch": "nedbat/artifact4-metacov-kit-notests",
        "head_sha": "8c85f6783103820ae61d07fe930fc19fa1acbc81"
      }
    }

The created_at time seems to be Pacific time with a Z suffix, while updated_at is GMT. The action was run ten minutes ago, just before 9AM Eastern time.

What did you expect to happen?

The two times should be the same, or at the very least, the time zone suffix in the ISO-8601 format should be correct.

How can we reproduce it?

I don't think I did anything unusual. The workflow step is here: https://github.com/nedbat/coveragepy/blob/8c85f6783103820ae61d07fe930fc19fa1acbc81/.github/workflows/coverage.yml#L102-L106

Anything else we need to know?

This example is Mac OS, but I see the same behavior on all OS's.

What version of the action are you using?

v4

What are your runner environments?

macos

Are you on GitHub Enterprise Server? If so, what version?

No response

robherley commented 11 months ago

👋 @nedbat Thanks for the report. The created_at timestamps for new Artifacts should be correct now.

nedbat commented 11 months ago

Yup, it's fixed, thanks!