-
Notifications
You must be signed in to change notification settings - Fork 191
61 lines (59 loc) · 2.02 KB
/
bump-cli.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Bump CLI version
on:
workflow_dispatch:
inputs:
option:
description: "Option"
required: true
default: 'replace'
type: choice
options:
- prepend
- replace
version:
description: |
The version to prepend to the supported versions file. This should be in the form: `vA.B.C`.
required: false
type: string
pull_request:
branches: [main]
paths:
- .github/actions/create-pr/action.yml
- .github/workflows/bump-cli.yml
schedule:
- cron: 0 0 */14 * * # run every 14 days
permissions:
contents: write
pull-requests: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Bump CLI
if: ${{ inputs.option == 'replace' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
scripts/replace-cli-version.sh
- name: Prepend another version
if: ${{ inputs.option == 'prepend' }}
run: |
cat extensions/ql-vscode/supported_cli_versions.json | jq '. |= ["${{ inputs.version }}"] + .' > supported_cli_versions_temp.json
mv supported_cli_versions_temp.json extensions/ql-vscode/supported_cli_versions.json
echo "LATEST_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
echo "PREVIOUS_VERSION=`jq -r '.[1]' extensions/ql-vscode/supported_cli_versions.json`" >> $GITHUB_ENV
- name: Commit, Push and Open a PR
uses: ./.github/actions/create-pr
with:
token: ${{ secrets.GITHUB_TOKEN }}
base-branch: main
head-branch: github-action/bump-cli
commit-message: Bump CLI version from ${{ env.PREVIOUS_VERSION }} to ${{ env.LATEST_VERSION }} for integration tests
title: Bump CLI Version to ${{ env.LATEST_VERSION }} for integration tests
body: >
Bumps CLI version from ${{ env.PREVIOUS_VERSION }} to ${{ env.LATEST_VERSION }}