update-cli #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update-cli | |
on: | |
repository_dispatch: | |
types: [update-cli] | |
workflow_dispatch: | |
inputs: | |
target_version: | |
description: 'Version of the CLI to update to' | |
required: true | |
type: string | |
jobs: | |
update-cli: | |
runs-on: ubuntu-latest | |
env: | |
# If triggered via repository_dispatch, read from payload; | |
# otherwise, read from workflow_dispatch input: | |
RAW_VERSION: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.cli_version || inputs.cli_version }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
ref: next | |
- name: Configure Git | |
run: | | |
git config --global user.name "Bumpsnag Bot" | |
git config --global user.email "" | |
- name: Fetch full history | |
run: git fetch --prune --unshallow | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
- name: Install dependencies | |
run: bundle install | |
- name: Remove leading 'v' | |
shell: bash | |
run: | | |
echo "CLI_VERSION=${RAW_VERSION#v}" >> $GITHUB_ENV | |
- name: Create update branch | |
run: | | |
git checkout -b cli-bump-${CLI_VERSION} next | |
- name: Update the CLI reference | |
run: | | |
echo "Bumping CLI to version $CLI_VERSION" | |
bundle exec rake "bump:cli[$CLI_VERSION]" | |
- run: bundle exec bumpsnag commit-update CLI $CLI_VERSION | |
- name: Create pull request | |
run: > | |
gh pr create -B next | |
-H bumpsnag-CLI-$CLI_VERSION | |
--title "Update CLI to version $CLI_VERSION" | |
--body 'Created by bumpsnag' | |
--reviewer rich-bugsnag |