Repository navigation
51 lines (41 loc) · 1.7 KB
/
Copy pathvalidate.yml
File metadata and controls
51 lines (41 loc) · 1.7 KB
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
name: Validate Branch Merge
on:
# ALLOW TRIGGERING ACTION MANUALLY
workflow_dispatch:
inputs:
source_branch:
required: true
type: string
target_branch:
required: true
type: string
# AFTER A PULL REQUEST IS OPENED / COMMITTED TO
pull_request:
types: [opened, synchronize]
paths:
# ALLOW TRIGGERING ACTION ONLY SPECIFIC PRs
- '.github/PULL_REQUEST_TEMPLATE.md'
env:
# CS TOOLS IS COMMAND LINE LIBRARY WRAPPING TS APIS
# https://thoughtspot.github.io/cs_tools/tools/git/
CS_TOOLS_VERSION: v1.5.10
CS_TOOLS_THOUGHTSPOT__URL: ${{ secrets.DEV_THOUGHTSPOT_URL }}
CS_TOOLS_THOUGHTSPOT__USERNAME: ${{ secrets.DEV_THOUGHTSPOT_USERNAME }}
CS_TOOLS_THOUGHTSPOT__SECRET_KEY: ${{ secrets.DEV_THOUGHTSPOT_SECRET_KEY }}
# THE NAMES OF YOUR BRANCH / THOUGHTSPOT ENVIRONMENTS TO VALIDATE CHANGES BETWEEN.
TS_SOURCE_ENV_NAME: ${{ github.event_name == 'workflow_dispatch' && inputs.source_branch || github.head_ref }}
TS_TARGET_ENV_NAME: ${{ github.event_name == 'workflow_dispatch' && inputs.target_branch || github.base_ref }}
jobs:
run_validate_api:
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install CS Tools
run: pip install "cs_tools[cli] @ https://github.com/thoughtspot/cs_tools/archive/${{ env.CS_TOOLS_VERSION }}.zip"
- name: Run the GIT VALIDATE command
run: "cs_tools tools git branches validate --source_branch ${{ env.TS_SOURCE_ENV_NAME }} --target_branch ${{ env.TS_TARGET_ENV_NAME }} --config ENV:"