dev-cmd/update-maintainers: write JSON of maintainers
This will be needed for Homebrew/homebrew-test-bot#933.
This commit is contained in:
		
							parent
							
								
									89dfe4fc5b
								
							
						
					
					
						commit
						909b8d078e
					
				
							
								
								
									
										1
									
								
								.github/maintainers.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.github/maintainers.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
[]
 | 
			
		||||
@ -66,7 +66,8 @@ jobs:
 | 
			
		||||
            git checkout "README.md" \
 | 
			
		||||
                         "docs/Manpage.md" \
 | 
			
		||||
                         "manpages/brew.1" \
 | 
			
		||||
                         "completions"
 | 
			
		||||
                         "completions" \
 | 
			
		||||
                         ".github/maintainers.json"
 | 
			
		||||
          else
 | 
			
		||||
            git checkout --no-track -B "${BRANCH}" origin/master
 | 
			
		||||
          fi
 | 
			
		||||
@ -83,7 +84,8 @@ jobs:
 | 
			
		||||
          then
 | 
			
		||||
            git add "README.md" \
 | 
			
		||||
                    "docs/Manpage.md" \
 | 
			
		||||
                    "manpages/brew.1"
 | 
			
		||||
                    "manpages/brew.1" \
 | 
			
		||||
                    ".github/maintainers.json"
 | 
			
		||||
            git commit -m "Update maintainers." \
 | 
			
		||||
                       -m "Autogenerated by the [sponsors-maintainers-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow."
 | 
			
		||||
            COMMITTED=true
 | 
			
		||||
 | 
			
		||||
@ -26,11 +26,15 @@ module Homebrew
 | 
			
		||||
 | 
			
		||||
    # We assume that only public members wish to be included in the README
 | 
			
		||||
    public_members = GitHub.public_member_usernames("Homebrew")
 | 
			
		||||
    maintainers = GitHub.members_by_team("Homebrew", "maintainers")
 | 
			
		||||
 | 
			
		||||
    HOMEBREW_MAINTAINER_JSON.write(maintainers.keys.to_json)
 | 
			
		||||
    maintainer_json_relative_path = HOMEBREW_MAINTAINER_JSON.relative_path_from(HOMEBREW_REPOSITORY).to_s
 | 
			
		||||
 | 
			
		||||
    members = {
 | 
			
		||||
      plc:         GitHub.members_by_team("Homebrew", "plc"),
 | 
			
		||||
      tsc:         GitHub.members_by_team("Homebrew", "tsc"),
 | 
			
		||||
      maintainers: GitHub.members_by_team("Homebrew", "maintainers"),
 | 
			
		||||
      maintainers: maintainers,
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    sentences = {}
 | 
			
		||||
@ -53,7 +57,7 @@ module Homebrew
 | 
			
		||||
    File.write(readme, content)
 | 
			
		||||
 | 
			
		||||
    diff = system_command "git", args: [
 | 
			
		||||
      "-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", "README.md"
 | 
			
		||||
      "-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", "README.md", maintainer_json_relative_path
 | 
			
		||||
    ]
 | 
			
		||||
    if diff.status.success?
 | 
			
		||||
      ofail "No changes to list of maintainers."
 | 
			
		||||
 | 
			
		||||
@ -42,6 +42,9 @@ HOMEBREW_CACHE_FORMULA = (HOMEBREW_CACHE/"Formula").freeze
 | 
			
		||||
# Where build, postinstall, and test logs of formulae are written to
 | 
			
		||||
HOMEBREW_LOGS = Pathname(ENV.fetch("HOMEBREW_LOGS")).expand_path.freeze
 | 
			
		||||
 | 
			
		||||
# Path to the list of Homebrew maintainers as a JSON file
 | 
			
		||||
HOMEBREW_MAINTAINER_JSON = (HOMEBREW_REPOSITORY/".github/maintainers.json").freeze
 | 
			
		||||
 | 
			
		||||
# Must use `/tmp` instead of `TMPDIR` because long paths break Unix domain sockets
 | 
			
		||||
HOMEBREW_TEMP = Pathname(ENV.fetch("HOMEBREW_TEMP")).then do |tmp|
 | 
			
		||||
  tmp.mkpath unless tmp.exist?
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user