google-api-ruby-client/.github/workflows/release-umbrella.yml

59 lines
2.1 KiB
YAML

on:
schedule:
- cron: '49 8 * * 1'
workflow_dispatch:
name: release-umbrella
jobs:
release-please:
env:
ENABLE_AUTO_APPROVE: ${{ secrets.ENABLE_AUTO_APPROVE }}
ENABLE_RELEASE_PLEASE: ${{ secrets.ENABLE_RELEASE_PLEASE }}
runs-on: ubuntu-latest
steps:
- name: ReleasePlease
id: release-please
if: ${{ env.ENABLE_RELEASE_PLEASE }}
uses: GoogleCloudPlatform/release-please-action@v2
with:
command: release-pr
token: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
fork: true
release-type: ruby
path: google-api-client
package-name: google-api-client
version-file: lib/google/apis/version.rb
monorepo-tags: true
bump-minor-pre-major: true
- name: AutoApprove
id: auto-approve
if: ${{ steps.release-please.outputs.pr }}
uses: actions/github-script@v2
with:
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
script: |
if (process.env.ENABLE_AUTO_APPROVE) {
core.info("ENABLE_AUTO_APPROVE is set; labeling and approving");
github.pulls.createReview({
owner: 'googleapis',
repo: 'google-api-ruby-client',
body: "AutoApprove: Rubber stamped release!",
pull_number: ${{ steps.release-please.outputs.pr }},
event: "APPROVE"
});
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "automerge", "kokoro:force-run"]
});
} else {
core.info("ENABLE_AUTO_APPROVE is not set; labeling release only");
github.issues.addLabels({
owner: 'googleapis',
repo: 'google-api-ruby-client',
issue_number: ${{ steps.release-please.outputs.pr }},
labels: ["autorelease: pending", "kokoro:force-run"]
});
}