Skip to content

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Nov 19, 2024

follow-up #471 (comment)

@trim2 Fyi, I see in response schema that commit.committer for /repos/{owner}/{repo}/commits/{ref}: https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#get-a-commit

Can be null:

        "committer": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "title": "Git User",
              "description": "Metaproperties for Git author/committer information.",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "examples": [
                    "\"Chris Wanstrath\""
                  ]
                },
                "email": {
                  "type": "string",
                  "examples": [
                    "\"chris@ozmm.org\""
                  ]
                },
                "date": {
                  "type": "string",
                  "examples": [
                    "\"2007-10-29T02:42:39.000-07:00\""
                  ]
                }
              }
            }
          ]
        },

If that happens it would just return the current date. I think that's fine but we could improve that as follow-up. Probably warn if that happens.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max changed the title fallback to current date if git committer date not available commit_date: code cleanup and readme updates Nov 19, 2024
@crazy-max crazy-max marked this pull request as ready for review November 19, 2024 14:51
@crazy-max crazy-max merged commit 359e915 into docker:master Nov 19, 2024
35 checks passed
@crazy-max crazy-max deleted the commit-date-changes branch November 19, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant