decaporg / decap-cms

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

Editorial workflow screen shows current user as author for all entries, not PR author #7232

Closed robbymilo closed 3 months ago

robbymilo commented 5 months ago

Screenshot from 2024-06-13 10-03-41

Describe the bug

The editorial workflow screen does not show the correct author of an entry.

To Reproduce

  1. Save an edit in editorial mode - do not publish it.
  2. Log in as another GitHub user.
  3. View the editorial workflow screen - the entry will show as if it were created by the current logged in user.

Expected behavior

The workflow screen should show the author of the PR.

Screenshots

Applicable Versions:

CMS configuration

n/a

Additional context

Happy to make an attempt with a PR to fix this if you can point me to the code :)

robbymilo commented 5 months ago

Looks like this was introduced by https://github.com/decaporg/decap-cms/releases/tag/decap-cms%403.1.1. 3.0.12 is working properly.

domcleal commented 4 months ago

I'm seeing this too on decap-cms-app@3.1.11 with decap-cms-backend-github@3.1.2. It's OK on decap-cms-app@3.0.12 and decap-cms-backend-github@3.0.3. All of the cards on the Workflow tab now show my name as the author, however the PRs and commits are from other authors.

Perhaps related to this commit, which seems to change the implementation of getPullRequestAuthor to just return the current user?

https://github.com/decaporg/decap-cms/commit/4f419dd27101c4db89d7f227b7a8bd9ac4b52fce#diff-dc40d227a33ffa35586e44b74c02b33b179e84e0c02004d5e993b821c8716650L578-L582

domcleal commented 4 months ago

Enabling the GraphQL API client seems to be a decent workaround, as it has a different getPullRequestAuthor implementation - add use_graphql: true to the backend configuration.

I've opened PR #7253 too.