badges / shields

Concise, consistent, and legible badges in SVG and raster format

Home Page:https://shields.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

github/last-commit is looking at the authored date and not the commit date

tkuhrt opened this issue Β· comments

Are you experiencing an issue with...

shields.io

🐞 Description

The github/last-commit/org/repo (https://img.shields.io/github/last-commit/hyperledger/cacti) badge shows the date using the authored date and not the committed date. Here is the commit in question:

    "commit": {
      "author": {
        "name": "zondervancalvez",
        "email": "zondervan.v.calvez@****.com",
        "date": "2023-11-20T07:09:42Z"
      },
      "committer": {
        "name": "Peter Somogyvari",
        "email": "petermetz@users.noreply.github.com",
        "date": "2024-05-29T18:12:31Z"
      },
      "message": "fix(cmd-api-server): address CVE-2022-25881\n\nPrimary Changes:\n\tUpdated the Dockerfile & https-cache-semantics inside the cmd-api-server package\n\nFixes: #2862\n\nSigned-off-by: zondervancalvez <zondervan.v.calvez@****.com>\nSigned-off-by: Peter Somogyvari <peter.somogyvari@****.com>",
      "tree": { 
        "sha": "150f754ac29b731c5aafa0fe70fe64afdec1aca2",
        "url": "https://api.github.com/repos/hyperledger/cacti/git/trees/150f754ac29b731c5aafa0fe70fe64afdec1aca2"
      },
      "url": "https://api.github.com/repos/hyperledger/cacti/git/commits/81da3334d8e638f85e398dd228bcef836a278230",
      "comment_count": 0,
      "verification": {
        "verified": false,
        "reason": "unsigned",
        "signature": null,
        "payload": null
      }
    },

πŸ”— Link to the badge

https://img.shields.io/github/last-commit/hyperledger/cacti

This will only show the issue until the next commit is added. Here is a screenshot for your reference.
Screenshot 2024-05-30 at 7 55 31β€―AM

πŸ’‘ Possible Solution

Use the commit.committer.date instead of the commit.author.date

Badge tested using npm run badge https://img.shields.io/github/last-commit/hyperledger/cacti
Output is available here

That is the default, but you can change it: https://img.shields.io/github/last-commit/hyperledger/cacti?display_timestamp=committer

Screenshot at 2024-05-30 20-00-15

I don't think we should make any change here. You can already configure the behaviour you are asking for,

Thanks @chris48s. My apologies for missing this option.