Skip to content

Commit e965c06

Browse files
authored
chore: put fork back in (googleapis#22397)
1 parent 931129a commit e965c06

8 files changed

Lines changed: 33 additions & 12 deletions

File tree

.github/workflows/new-library.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
gem install --no-document toys
2727
- name: Create library
2828
run: |
29-
toys new-library -v --pull --test --remote=origin --bootstrap-releases ${{ github.event.inputs.protoPath }}
29+
toys new-library -v --pull --test --fork --bootstrap-releases ${{ github.event.inputs.protoPath }}

.github/workflows/obsolete-library.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
gem install --no-document toys
2929
- name: Obsolete-library
3030
run: |
31-
toys obsolete-library -v --remote=origin ${{ github.event.inputs.flags }} ${{ github.event.inputs.gem }}
31+
toys obsolete-library -v --fork ${{ github.event.inputs.flags }} ${{ github.event.inputs.gem }}

.github/workflows/owlbot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
gem install --no-document toys
3030
- name: OwlBot
3131
run: |
32-
toys owlbot -v --pull --remote=origin ${{ github.event.inputs.flags }} ${{ github.event.inputs.gems }}
32+
toys owlbot -v --pull --fork ${{ github.event.inputs.flags }} ${{ github.event.inputs.gems }}

.github/workflows/release-please-bootstrap.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ jobs:
1515
steps:
1616
- name: Checkout repo
1717
uses: actions/checkout@v3
18-
- name: Install Ruby 3.0
18+
- name: Install Ruby 3.2
1919
uses: ruby/setup-ruby@v1
2020
with:
21-
ruby-version: "3.0"
21+
ruby-version: "3.2"
2222
- name: Install tools
23-
run: "gem install --no-document toys"
23+
run: |
24+
gem install --no-document toys
2425
- name: execute
2526
run: |
26-
toys release bootstrap -v --remote=origin ${{ github.event.inputs.gems }}
27+
toys release bootstrap -v --fork ${{ github.event.inputs.gems }}

.github/workflows/release-please.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
steps:
2020
- name: Checkout repo
2121
uses: actions/checkout@v3
22-
- name: Install Ruby 3.0
22+
- name: Install Ruby 3.2
2323
uses: ruby/setup-ruby@v1
2424
with:
25-
ruby-version: "3.0"
25+
ruby-version: "3.2"
2626
- name: Install NodeJS 16.x
2727
uses: actions/setup-node@v3
2828
with:

.github/workflows/update-release-levels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
gem install --no-document toys
2525
- name: execute
2626
run: |
27-
toys update-release-levels --remote=origin ${{ github.event.inputs.args }}
27+
toys update-release-levels --fork ${{ github.event.inputs.args }}

.toys/release.rb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
flag :git_remote, "--remote NAME" do
4141
desc "The name of the git remote to use as the pull request head. If omitted, does not open a pull request."
4242
end
43-
43+
flag :enable_fork, "--fork" do
44+
desc "Use a fork to open the pull request"
45+
end
46+
4447
include :exec, e: true
4548
include :terminal
4649
include "yoshi-pr-generator"
@@ -56,10 +59,11 @@ def run
5659
end
5760
puts "Adding #{packages.size} packages..."
5861

62+
setup_git
63+
5964
date = Time.now.utc.strftime("%Y%m%d-%H%M%S")
6065
set :branch_name, "gen/bootstrap-release-#{date}" unless branch_name
6166
commit_message = "chore: Bootstrap release manifest for new packages"
62-
yoshi_utils.git_ensure_identity
6367
yoshi_pr_generator.capture enabled: !git_remote.nil?,
6468
remote: git_remote,
6569
branch_name: branch_name,
@@ -68,6 +72,14 @@ def run
6872
end
6973
end
7074

75+
def setup_git
76+
yoshi_utils.git_ensure_identity
77+
if enable_fork
78+
set :git_remote, "pull-request-fork" unless git_remote
79+
yoshi_utils.gh_ensure_fork remote: git_remote
80+
end
81+
end
82+
7183
def update_manifest_files
7284
config = JSON.parse File.read config_name
7385
manifest = JSON.parse File.read manifest_name

.toys/update-release-levels.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
flag :git_remote, "--remote=NAME" do
2020
desc "The name of the git remote to use as the pull request head. If omitted, does not open a pull request."
2121
end
22+
flag :enable_fork, "--fork" do
23+
desc "Use a fork to open the pull request"
24+
end
2225

2326
include :exec, e: true
2427
include "yoshi-pr-generator"
@@ -27,6 +30,11 @@ def run
2730
require "json"
2831

2932
yoshi_utils.git_ensure_identity
33+
if enable_fork
34+
set :git_remote, "pull-request-fork" unless git_remote
35+
yoshi_utils.gh_ensure_fork remote: git_remote
36+
end
37+
3038
updated, pr_result = update_release_levels
3139
output_result updated, pr_result
3240
end

0 commit comments

Comments
 (0)