Last active
October 5, 2022 16:47
-
-
Save rbrooks/ade2afa4db5d5fb09ab8cf2b3651f943 to your computer and use it in GitHub Desktop.
Get Code Owner from CODEOWNERS
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
# Given a path on CODEOWNERS file, returns the username of code owner. | |
# CODEOWNERS file is either space or Tab-delimated. Hence the 2nd `cut` that slices on Tab. | |
# That's an actual Tab char between the ' '. It wouldn't accept '\t'. | |
# Here it is working on a Tab-deleimited line: | |
grep app/interactors/account/assign_reports_to/ .github/CODEOWNERS | cut -f2- -d ' ' | cut -f2- -d ' ' | |
# @templeman15 | |
# Here it is working on a Space-deleimited line: | |
grep app/models/paywall_registry.rb .github/CODEOWNERS | cut -f2- -d ' ' | cut -f2- -d ' ' | |
# @bwarni | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment