Support editor lookup by GitHub username#2054
Merged
kfranqueiro merged 8 commits intomainfrom Mar 6, 2026
Merged
Conversation
deniak
requested changes
Mar 5, 2026
daa5e72 to
10f3e0a
Compare
deniak
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements resolving GitHub usernames via the
data-editor-githubattribute, as an alternative todata-editor-id.As this involves requests to GitHub's
usersAPI, theGH_TOKENenvironment variable is checked for a token to pass.Changes
resolveGithubUsernameToIdutility function tolib/rules/util.js, which resolves a GitHub username to a W3C IDnullif the GitHub username is not found in either system (404); throws an error if any other HTTP error occursheaders/dl.js,headers/editor-participation.js, andmetadata/editor-ids.jspertaining to GitHub username lookup; each of these checks for null return values and catches errors to report the appropriate error messagegetEditorIDslogic fromlib/validator.jstolib/rules/metadata/editor-ids.js, as this was the only place it was used, and this relegates allresolveGithubUsernameToIdcalls torulesmodulesdata-editor-githubtoeditorSectionrule inlib/rules.jsonsr.errorwithin each rule module, although they have the same content; the thought was that the more criticalsr.throwwould be excessivetargetfrom tsconfig, which was set to an excessively-old value which caused an interop issue with octokit's typings (the default isesnextwhenmoduleisnodenext)