-
Notifications
You must be signed in to change notification settings - Fork 184
37 lines (36 loc) · 1.33 KB
/
update-chat-version.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
name: Update Chat Version
on:
workflow_dispatch:
inputs:
version:
description: 'Chat Version (example: "v1.2.3")'
required: false
jobs:
update-chat-version:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_BUILDER_TOKEN }}
- name: Setup git
run: |
set -ex
git config --global user.email "builder+skip-ci@codota.com"
git config --global user.name "codota-builder"
- name: Get latest release version
id: get_version
run: |
if [ -z "${{ inputs.version }}" ]; then
latest_version=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/codota/tabnine-chat-app/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')
echo "::set-output name=version::${latest_version}"
else
echo "::set-output name=version::${{ inputs.version }}"
fi
- name: Set Chat Version
run: echo "${{ steps.get_version.outputs.version }}" > .chatversion
- name: Commit Change
run: |
git add .chatversion
git diff --quiet && git diff --staged --quiet || git commit -m "Chat version updated to ${{ github.event.inputs.version }}"
git push