decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.97k stars 3.05k forks source link

fix: fetch GitHub PR author name, fixes #7232 #7253

Closed domcleal closed 3 months ago

domcleal commented 4 months ago

Summary

This corrects the author names displayed beneath each in-flight pull request when using the editorial workflow with a GitHub backend. Since Decap 3.1, only the current user's name was being displayed beneath each workflow entry, as reported in #7232.

It reverts the change to getPullRequestAuthor in the GitHub backend from 4f419dd, so that it fetches the PR author's name as before.

I've added a basic implementation for the AWS Cognito backend to simply return the GitHub login as the author name. I'm not sure what else we could display here if it's acting as a proxy to GitHub, and I don't think there's a mechanism to either identify the user who opened the PR or to look up their name, unless @soceanainn can advise.

Test plan

Configure a github backend in dev-test/config.yml, with multiple PRs open on the test repo by different authors.

Before on main (at 61795688ea9549af6d4dbab472b9aa83d9b11ec9):

image

After on this branch:

image

The second entry, which is a PR opened by a different GitHub user, shows the correct name from GitHub ("Test user real name") instead of my name on both PRs.

Checklist

Please add a x inside each checkbox: