Skip to content

Commit e421ac1

Browse files
authored
chore: Update release-please jobs to run nightly and not auto-approve (googleapis#2488)
1 parent c8c1039 commit e421ac1

File tree

3 files changed

+33
-87
lines changed

3 files changed

+33
-87
lines changed

.github/workflows/release-core.yml

+11-29
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
on:
22
schedule:
3-
- cron: '29 8 * * 1'
3+
- cron: '29 8 * * *'
44
workflow_dispatch:
55

66
name: release-core
77
jobs:
88
release-please:
99
env:
10-
ENABLE_AUTO_APPROVE: ${{ secrets.ENABLE_AUTO_APPROVE }}
1110
ENABLE_RELEASE_PLEASE: ${{ secrets.ENABLE_RELEASE_PLEASE }}
1211
runs-on: ubuntu-latest
1312
steps:
1413
- name: ReleasePlease
1514
id: release-please
16-
if: ${{ env.ENABLE_RELEASE_PLEASE }}
15+
if: ${{ env.ENABLE_RELEASE_PLEASE || github.event_name == 'workflow_dispatch' }}
1716
uses: GoogleCloudPlatform/release-please-action@v2
1817
with:
1918
command: release-pr
@@ -25,34 +24,17 @@ jobs:
2524
version-file: lib/google/apis/core/version.rb
2625
monorepo-tags: true
2726
bump-minor-pre-major: true
28-
- name: AutoApprove
29-
id: auto-approve
27+
- name: ReleaseLabel
28+
id: release-label
3029
if: ${{ steps.release-please.outputs.pr }}
3130
uses: actions/github-script@v2
3231
with:
3332
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
3433
script: |
35-
if (process.env.ENABLE_AUTO_APPROVE) {
36-
core.info("ENABLE_AUTO_APPROVE is set; labeling and approving");
37-
github.pulls.createReview({
38-
owner: 'googleapis',
39-
repo: 'google-api-ruby-client',
40-
body: "AutoApprove: Rubber stamped release!",
41-
pull_number: ${{ steps.release-please.outputs.pr }},
42-
event: "APPROVE"
43-
});
44-
github.issues.addLabels({
45-
owner: 'googleapis',
46-
repo: 'google-api-ruby-client',
47-
issue_number: ${{ steps.release-please.outputs.pr }},
48-
labels: ["autorelease: pending", "automerge", "kokoro:force-run"]
49-
});
50-
} else {
51-
core.info("ENABLE_AUTO_APPROVE is not set; labeling release only");
52-
github.issues.addLabels({
53-
owner: 'googleapis',
54-
repo: 'google-api-ruby-client',
55-
issue_number: ${{ steps.release-please.outputs.pr }},
56-
labels: ["autorelease: pending", "kokoro:force-run"]
57-
});
58-
}
34+
core.info("Labeling release");
35+
github.issues.addLabels({
36+
owner: 'googleapis',
37+
repo: 'google-api-ruby-client',
38+
issue_number: ${{ steps.release-please.outputs.pr }},
39+
labels: ["autorelease: pending", "kokoro:force-run"]
40+
});
+11-29
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
on:
22
schedule:
3-
- cron: '39 8 * * 1'
3+
- cron: '39 8 * * *'
44
workflow_dispatch:
55

66
name: release-generator
77
jobs:
88
release-please:
99
env:
10-
ENABLE_AUTO_APPROVE: ${{ secrets.ENABLE_AUTO_APPROVE }}
1110
ENABLE_RELEASE_PLEASE: ${{ secrets.ENABLE_RELEASE_PLEASE }}
1211
runs-on: ubuntu-latest
1312
steps:
1413
- name: ReleasePlease
1514
id: release-please
16-
if: ${{ env.ENABLE_RELEASE_PLEASE }}
15+
if: ${{ env.ENABLE_RELEASE_PLEASE || github.event_name == 'workflow_dispatch' }}
1716
uses: GoogleCloudPlatform/release-please-action@v2
1817
with:
1918
command: release-pr
@@ -25,34 +24,17 @@ jobs:
2524
version-file: lib/google/apis/generator/version.rb
2625
monorepo-tags: true
2726
bump-minor-pre-major: true
28-
- name: AutoApprove
29-
id: auto-approve
27+
- name: ReleaseLabel
28+
id: release-label
3029
if: ${{ steps.release-please.outputs.pr }}
3130
uses: actions/github-script@v2
3231
with:
3332
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
3433
script: |
35-
if (process.env.ENABLE_AUTO_APPROVE) {
36-
core.info("ENABLE_AUTO_APPROVE is set; labeling and approving");
37-
github.pulls.createReview({
38-
owner: 'googleapis',
39-
repo: 'google-api-ruby-client',
40-
body: "AutoApprove: Rubber stamped release!",
41-
pull_number: ${{ steps.release-please.outputs.pr }},
42-
event: "APPROVE"
43-
});
44-
github.issues.addLabels({
45-
owner: 'googleapis',
46-
repo: 'google-api-ruby-client',
47-
issue_number: ${{ steps.release-please.outputs.pr }},
48-
labels: ["autorelease: pending", "automerge", "kokoro:force-run"]
49-
});
50-
} else {
51-
core.info("ENABLE_AUTO_APPROVE is not set; labeling release only");
52-
github.issues.addLabels({
53-
owner: 'googleapis',
54-
repo: 'google-api-ruby-client',
55-
issue_number: ${{ steps.release-please.outputs.pr }},
56-
labels: ["autorelease: pending", "kokoro:force-run"]
57-
});
58-
}
34+
core.info("Labeling release");
35+
github.issues.addLabels({
36+
owner: 'googleapis',
37+
repo: 'google-api-ruby-client',
38+
issue_number: ${{ steps.release-please.outputs.pr }},
39+
labels: ["autorelease: pending", "kokoro:force-run"]
40+
});
+11-29
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
on:
22
schedule:
3-
- cron: '49 8 * * 1'
3+
- cron: '49 8 * * *'
44
workflow_dispatch:
55

66
name: release-umbrella
77
jobs:
88
release-please:
99
env:
10-
ENABLE_AUTO_APPROVE: ${{ secrets.ENABLE_AUTO_APPROVE }}
1110
ENABLE_RELEASE_PLEASE: ${{ secrets.ENABLE_RELEASE_PLEASE }}
1211
runs-on: ubuntu-latest
1312
steps:
1413
- name: ReleasePlease
1514
id: release-please
16-
if: ${{ env.ENABLE_RELEASE_PLEASE }}
15+
if: ${{ env.ENABLE_RELEASE_PLEASE || github.event_name == 'workflow_dispatch' }}
1716
uses: GoogleCloudPlatform/release-please-action@v2
1817
with:
1918
command: release-pr
@@ -25,34 +24,17 @@ jobs:
2524
version-file: lib/google/apis/version.rb
2625
monorepo-tags: true
2726
bump-minor-pre-major: true
28-
- name: AutoApprove
29-
id: auto-approve
27+
- name: ReleaseLabel
28+
id: release-label
3029
if: ${{ steps.release-please.outputs.pr }}
3130
uses: actions/github-script@v2
3231
with:
3332
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
3433
script: |
35-
if (process.env.ENABLE_AUTO_APPROVE) {
36-
core.info("ENABLE_AUTO_APPROVE is set; labeling and approving");
37-
github.pulls.createReview({
38-
owner: 'googleapis',
39-
repo: 'google-api-ruby-client',
40-
body: "AutoApprove: Rubber stamped release!",
41-
pull_number: ${{ steps.release-please.outputs.pr }},
42-
event: "APPROVE"
43-
});
44-
github.issues.addLabels({
45-
owner: 'googleapis',
46-
repo: 'google-api-ruby-client',
47-
issue_number: ${{ steps.release-please.outputs.pr }},
48-
labels: ["autorelease: pending", "automerge", "kokoro:force-run"]
49-
});
50-
} else {
51-
core.info("ENABLE_AUTO_APPROVE is not set; labeling release only");
52-
github.issues.addLabels({
53-
owner: 'googleapis',
54-
repo: 'google-api-ruby-client',
55-
issue_number: ${{ steps.release-please.outputs.pr }},
56-
labels: ["autorelease: pending", "kokoro:force-run"]
57-
});
58-
}
34+
core.info("ENABLE_AUTO_APPROVE is not set; labeling release only");
35+
github.issues.addLabels({
36+
owner: 'googleapis',
37+
repo: 'google-api-ruby-client',
38+
issue_number: ${{ steps.release-please.outputs.pr }},
39+
labels: ["autorelease: pending", "kokoro:force-run"]
40+
});

0 commit comments

Comments
 (0)