Skip to content

Commit 160ee22

Browse files
committed
combined version change and bump-cli workflow
1 parent bfa6780 commit 160ee22

2 files changed

Lines changed: 21 additions & 56 deletions

File tree

.github/workflows/bump-cli.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
name: Bump CLI version
22
on:
33
workflow_dispatch:
4+
inputs:
5+
option:
6+
description: "Option"
7+
required: true
8+
default: 'replace'
9+
type: choice
10+
options:
11+
- prepend
12+
- replace
13+
version:
14+
description: "Version"
15+
required: false
16+
type: string
417
pull_request:
518
branches: [main]
619
paths:
@@ -23,10 +36,18 @@ jobs:
2336
with:
2437
fetch-depth: 1
2538
- name: Bump CLI
39+
if: ${{ inputs.option == 'replace' }}
2640
env:
2741
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2842
run: |
2943
scripts/replace-cli-version.sh
44+
- name: Prepend another version
45+
if: ${{ inputs.option == 'prepend' }}
46+
run: |
47+
cat supported_cli_versions.json | jq '. |= ["${{ inputs.version }}"] + .' > supported_cli_versions_temp.json
48+
mv supported_cli_versions_temp.json supported_cli_versions.json
49+
echo "LATEST_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
50+
echo "PREVIOUS_VERSION=`jq -r '.[1]' supported_cli_versions.json`" >> $GITHUB_ENV
3051
- name: Commit, Push and Open a PR
3152
uses: ./.github/actions/create-pr
3253
with:

.github/workflows/version-change.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)