mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
dev-cmd/tap-new: support private repos
This commit is contained in:
parent
0e7f19f2f1
commit
875702d51a
@ -72,6 +72,13 @@ module Homebrew
|
|||||||
# <!-- vale on -->
|
# <!-- vale on -->
|
||||||
write_path(tap, "README.md", readme)
|
write_path(tap, "README.md", readme)
|
||||||
|
|
||||||
|
tests_permissions = {
|
||||||
|
"actions" => "read",
|
||||||
|
"checks" => "read",
|
||||||
|
"contents" => "read",
|
||||||
|
"pull-requests" => "read",
|
||||||
|
}
|
||||||
|
tests_permissions["packages"] = "read" if args.github_packages?
|
||||||
actions_main = <<~YAML
|
actions_main = <<~YAML
|
||||||
name: brew test-bot
|
name: brew test-bot
|
||||||
|
|
||||||
@ -87,10 +94,14 @@ module Homebrew
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-22.04, macos-13, macos-15]
|
os: [ubuntu-22.04, macos-13, macos-15]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
permissions:
|
||||||
|
#{tests_permissions.sort.map { |k, v| " #{k}: #{v}" }.join("\n")}
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Homebrew
|
- name: Set up Homebrew
|
||||||
id: set-up-homebrew
|
id: set-up-homebrew
|
||||||
uses: Homebrew/actions/setup-homebrew@master
|
uses: Homebrew/actions/setup-homebrew@master
|
||||||
|
with:
|
||||||
|
token: ${{ github.token }}
|
||||||
|
|
||||||
- name: Cache Homebrew Bundler RubyGems
|
- name: Cache Homebrew Bundler RubyGems
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@ -105,8 +116,20 @@ module Homebrew
|
|||||||
|
|
||||||
- run: brew test-bot --only-tap-syntax
|
- run: brew test-bot --only-tap-syntax
|
||||||
|
|
||||||
|
- name: Base64-encode GITHUB_TOKEN
|
||||||
|
id: base64-encode
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
base64_token=$(echo -n "${TOKEN}" | base64 | tr -d "\\n")
|
||||||
|
echo "::add-mask::${base64_token}"
|
||||||
|
echo "token=${base64_token}" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
- run: brew test-bot --only-formulae#{" --root-url='#{root_url}'" if root_url}
|
- run: brew test-bot --only-formulae#{" --root-url='#{root_url}'" if root_url}
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
|
env:
|
||||||
|
HOMEBREW_DOCKER_REGISTRY_TOKEN: ${{ steps.base64-encode.outputs.token }}
|
||||||
|
|
||||||
- name: Upload bottles as artifact
|
- name: Upload bottles as artifact
|
||||||
if: always() && github.event_name == 'pull_request'
|
if: always() && github.event_name == 'pull_request'
|
||||||
@ -117,7 +140,10 @@ module Homebrew
|
|||||||
YAML
|
YAML
|
||||||
|
|
||||||
pr_pull_permissions = {
|
pr_pull_permissions = {
|
||||||
|
"actions" => "read",
|
||||||
|
"checks" => "read",
|
||||||
"contents" => "write",
|
"contents" => "write",
|
||||||
|
"issues" => "read",
|
||||||
"pull-requests" => "write",
|
"pull-requests" => "write",
|
||||||
}
|
}
|
||||||
pr_pull_env = {
|
pr_pull_env = {
|
||||||
@ -145,6 +171,8 @@ module Homebrew
|
|||||||
steps:
|
steps:
|
||||||
- name: Set up Homebrew
|
- name: Set up Homebrew
|
||||||
uses: Homebrew/actions/setup-homebrew@master
|
uses: Homebrew/actions/setup-homebrew@master
|
||||||
|
with:
|
||||||
|
token: ${{ github.token }}
|
||||||
|
|
||||||
- name: Set up git
|
- name: Set up git
|
||||||
uses: Homebrew/actions/git-user-config@master
|
uses: Homebrew/actions/git-user-config@master
|
||||||
@ -158,7 +186,6 @@ module Homebrew
|
|||||||
- name: Push commits
|
- name: Push commits
|
||||||
uses: Homebrew/actions/git-try-push@master
|
uses: Homebrew/actions/git-try-push@master
|
||||||
with:
|
with:
|
||||||
token: ${{ github.token }}
|
|
||||||
branch: #{branch}
|
branch: #{branch}
|
||||||
|
|
||||||
- name: Delete branch
|
- name: Delete branch
|
||||||
|
Loading…
x
Reference in New Issue
Block a user