mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Improve update_owners.py username detection and error message.
Also, skip _output.
This commit is contained in:
parent
bc7ae399f8
commit
20754c0f5c
@ -116,12 +116,12 @@ def get_maintainers():
|
||||
|
||||
|
||||
def detect_github_username():
|
||||
remotes = subprocess.check_output(['git', 'remote', '-v'])
|
||||
repos = set(re.findall(r'\w+(?=/kubernetes)', remotes))
|
||||
repos.remove('kubernetes')
|
||||
if len(repos) == 1:
|
||||
return repos.pop()
|
||||
raise ValueError('unable to guess GitHub user from `git remote -v` output, use --user instead')
|
||||
origin_url = subprocess.check_output(['git', 'config', 'remote.origin.url'])
|
||||
m = re.search(r'github.com[:/](.*)/', origin_url)
|
||||
if m and m.group(1) != 'kubernetes':
|
||||
return m.group(1)
|
||||
raise ValueError('unable to determine GitHub user from '
|
||||
'`git config remote.origin.url` output, run with --user instead')
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -237,7 +237,8 @@ func (t *testList) handlePath(path string, info os.FileInfo, err error) error {
|
||||
return err
|
||||
}
|
||||
if strings.Contains(path, "third_party") ||
|
||||
strings.Contains(path, "staging") {
|
||||
strings.Contains(path, "staging") ||
|
||||
strings.Contains(path, "_output") {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
if strings.HasSuffix(path, ".go") && strings.Contains(path, "e2e") ||
|
||||
|
Loading…
Reference in New Issue
Block a user