Skip to content

Commit bd74b41

Browse files
authored
Merge pull request #1973 from github/tjgurwara99/bump-cli-extension
Modifying the `bump-cli` workflow to append/replace version from `supported_cli_versions.json`
2 parents 4dc1b12 + f154b59 commit bd74b41

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/bump-cli.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
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: |
15+
The version to prepend to the supported versions file. This should be in the form: `vA.B.C`.
16+
required: false
17+
type: string
418
pull_request:
519
branches: [main]
620
paths:
@@ -23,10 +37,18 @@ jobs:
2337
with:
2438
fetch-depth: 1
2539
- name: Bump CLI
40+
if: ${{ inputs.option == 'replace' }}
2641
env:
2742
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2843
run: |
2944
scripts/replace-cli-version.sh
45+
- name: Prepend another version
46+
if: ${{ inputs.option == 'prepend' }}
47+
run: |
48+
cat supported_cli_versions.json | jq '. |= ["${{ inputs.version }}"] + .' > supported_cli_versions_temp.json
49+
mv supported_cli_versions_temp.json supported_cli_versions.json
50+
echo "LATEST_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
51+
echo "PREVIOUS_VERSION=`jq -r '.[1]' supported_cli_versions.json`" >> $GITHUB_ENV
3052
- name: Commit, Push and Open a PR
3153
uses: ./.github/actions/create-pr
3254
with:

0 commit comments

Comments
 (0)