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

Improvements for GitHub Enterprise #1065

Merged
merged 15 commits into from
Dec 6, 2023
Merged

Improvements for GitHub Enterprise #1065

merged 15 commits into from
Dec 6, 2023

Conversation

ldaneliukas
Copy link
Contributor

@ldaneliukas ldaneliukas commented Dec 4, 2023

In GitHub Enterprise there can be two different cases that the current action does not account for:

  • The committer can be empty, whilst the author is present (applies to public GitHub too)
  • The rate limit can be turned off completely and attempting to retrieve will throw errors.

Changes:

  • Cover all cases where login can be found - committer.login, author.login, commit.committer.name and commit.author.name.
  • Continue checking for the rate-limit by default but allow turning it off.

Real API response excerpt that this is based on:

{
  "sha": "fdfbacc74635350b2d6d6d78d96a80dd017f0aaf",
  "node_id": "MDY6Q29tbWl0MjE3NjpmZGZiYWNjNzQ2MzUzNTBiMmQ2ZDZkNzhkOTZhODBkZDAxN2YwYWFm",
  "commit": {
    "author": {
      "name": "u-name",
      "email": "u.name@example.com",
      "date": "2023-09-24T16:27:01Z"
    },
    "committer": {
      "name": "u-name",
      "email": "u.name@example.com",
      "date": "2023-09-24T16:27:01Z"
    }
  },
  "author": null,
  "committer": null
}

Testing

Before:
image

After:
image

There are cases where the committer is empty, but the author is not. Use that when there's no committer info.
@ldaneliukas ldaneliukas changed the title Fallback to author.login if committer.login isn't available Improvements for GitHub Enterprise Dec 4, 2023
@crs-k crs-k added the enhancement 💎 New feature or request label Dec 6, 2023
@crs-k crs-k merged commit c020f08 into crs-k:main Dec 6, 2023
5 checks passed
@crs-k
Copy link
Owner

crs-k commented Dec 6, 2023

thanks @ldaneliukas, i'll cut a new release shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💎 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants