Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commit_date: code cleanup and readme updates #475

Merged
merged 1 commit into from
Nov 19, 2024

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": [
                    "\"[email protected]\""
                  ]
                },
                "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.

@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