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

Add [GitHubLastCommit] by committer badge #8537

Merged

Conversation

PaulaBarszcz
Copy link
Collaborator

@PaulaBarszcz PaulaBarszcz commented Oct 16, 2022

closes #6236

I added the display_timestamp queryParam, with options author and committer, defaulting to author.

const queryParamSchema = Joi.object({
  display_timestamp: Joi.string()
    .valid('author', 'committer')
    .default('author'),
}).required()

...

  async handle({ user, repo, branch }, queryParams) {
    const body = await this.fetch({ user, repo, branch })

    return this.constructor.render({
      commitDate: body[0].commit[queryParams.display_timestamp].date,
    })
  }

I checked a couple of repos (for example https://api.github.com/repos/zero-to-mastery/start-here-guidelines/commits) but I couldn't find an example with a different date for author and committer.

http://localhost:8080/github/last-commit/google/skia/infra/config?display_timestamp=committer

image

@shields-ci
Copy link

shields-ci commented Oct 16, 2022

Messages
📖 ✨ Thanks for your contribution to Shields, @PaulaBarszcz!

Generated by 🚫 dangerJS against 5b818c0

@PaulaBarszcz PaulaBarszcz marked this pull request as ready for review October 16, 2022 14:22
}).required(),
}).required()
)
.required()

const queryParamSchema = Joi.object({
by_committer: Joi.equal(''),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to #8543 (comment) I'd make this display_timestamp with options author and committer defaulting to author

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks. Updated

@PaulaBarszcz
Copy link
Collaborator Author

Hi @chris48s
For some reason integration tests failed here:
image
https://github.com/badges/shields/actions/runs/3290599111/jobs/5423657553

@chris48s
Copy link
Member

I think the integration test failure is probably related to #8535 / #8538

@chris48s chris48s added service-badge Accepted and actionable changes, features, and bugs squash when passing labels Oct 20, 2022
@repo-ranger repo-ranger bot merged commit c0087ca into badges:master Oct 20, 2022
@pukkandan
Copy link

Thanks

@PaulaBarszcz PaulaBarszcz deleted the github-last-commit-based-on-committer branch October 21, 2022 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Badge request: GitHub last-commit variant based on "committer" timestamp
4 participants