chore: Update release-please action to take advantage of upstream fixes (#1651)
This commit is contained in:
parent
80e2fadffd
commit
df748da840
|
@ -12,8 +12,9 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: ReleasePlease
|
- name: ReleasePlease
|
||||||
|
id: release-please
|
||||||
if: ${{ env.ENABLE_RELEASE_PLEASE }}
|
if: ${{ env.ENABLE_RELEASE_PLEASE }}
|
||||||
uses: GoogleCloudPlatform/release-please-action@v2.5.7
|
uses: GoogleCloudPlatform/release-please-action@v2
|
||||||
with:
|
with:
|
||||||
command: release-pr
|
command: release-pr
|
||||||
token: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
|
token: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
|
||||||
|
@ -24,40 +25,25 @@ jobs:
|
||||||
monorepo-tags: true
|
monorepo-tags: true
|
||||||
bump-minor-pre-major: true
|
bump-minor-pre-major: true
|
||||||
- name: AutoApprove
|
- name: AutoApprove
|
||||||
if: ${{ always() && env.ENABLE_RELEASE_PLEASE }}
|
id: auto-approve
|
||||||
|
if: ${{ steps.release-please.outputs.pr }}
|
||||||
uses: actions/github-script@v2
|
uses: actions/github-script@v2
|
||||||
with:
|
with:
|
||||||
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
|
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
|
||||||
script: |
|
script: |
|
||||||
let found = false;
|
|
||||||
for (let tries = 3; tries > 0; tries--) {
|
|
||||||
await new Promise(r => setTimeout(r, 2000));
|
|
||||||
const prs = await github.pulls.list({
|
|
||||||
owner: 'googleapis',
|
|
||||||
repo: 'google-api-ruby-client',
|
|
||||||
state: 'open',
|
|
||||||
sort: 'created',
|
|
||||||
direction: 'desc',
|
|
||||||
per_page: 10
|
|
||||||
});
|
|
||||||
prs.data.forEach(function(pr) {
|
|
||||||
if (found || pr.user.login != "yoshi-code-bot" || !pr.title.startsWith("Release ")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
core.info("AutoApprove: Found release PR " + pr.number);
|
|
||||||
if (process.env.ENABLE_AUTO_APPROVE) {
|
if (process.env.ENABLE_AUTO_APPROVE) {
|
||||||
core.info("ENABLE_AUTO_APPROVE is set; labeling and approving");
|
core.info("ENABLE_AUTO_APPROVE is set; labeling and approving");
|
||||||
github.pulls.createReview({
|
github.pulls.createReview({
|
||||||
owner: 'googleapis',
|
owner: 'googleapis',
|
||||||
repo: 'google-api-ruby-client',
|
repo: 'google-api-ruby-client',
|
||||||
body: "AutoApprove: Rubber stamped release!",
|
body: "AutoApprove: Rubber stamped release!",
|
||||||
pull_number: pr.number,
|
pull_number: ${{ steps.release-please.outputs.pr }},
|
||||||
event: "APPROVE"
|
event: "APPROVE"
|
||||||
});
|
});
|
||||||
github.issues.addLabels({
|
github.issues.addLabels({
|
||||||
owner: 'googleapis',
|
owner: 'googleapis',
|
||||||
repo: 'google-api-ruby-client',
|
repo: 'google-api-ruby-client',
|
||||||
issue_number: pr.number,
|
issue_number: ${{ steps.release-please.outputs.pr }},
|
||||||
labels: ["autorelease: pending", "automerge", "kokoro:force-run"]
|
labels: ["autorelease: pending", "automerge", "kokoro:force-run"]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -65,15 +51,7 @@ jobs:
|
||||||
github.issues.addLabels({
|
github.issues.addLabels({
|
||||||
owner: 'googleapis',
|
owner: 'googleapis',
|
||||||
repo: 'google-api-ruby-client',
|
repo: 'google-api-ruby-client',
|
||||||
issue_number: pr.number,
|
issue_number: ${{ steps.release-please.outputs.pr }},
|
||||||
labels: ["autorelease: pending", "kokoro:force-run"]
|
labels: ["autorelease: pending", "kokoro:force-run"]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
core.info("AutoApprove: complete!");
|
|
||||||
found = true;
|
|
||||||
tries = 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!found) {
|
|
||||||
core.setFailed("Unable to find release PR after 3 tries.");
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue