-
Notifications
You must be signed in to change notification settings - Fork 52
41 lines (41 loc) · 1.87 KB
/
gui-checks.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
name: GUIChecks
on:
pull_request:
paths:
- 'tasks/*'
- 'workflows/*'
push:
branches:
- 'master'
env:
LIST_OF_VARIABLES: \[-trg_global_run_enabled:-\]\[-dcs_enabled:-\]\|\[-trg_enabled:-\]\|\[-epn_enabled:-\]\|\[-odc_topology:-\]\|\[-odc_enabled:-\]\|\[-qcdd_enabled:-\]\|\[-dd_enabled:-\]\|\[-ddsched_enabled:-\]\|\[-minimal_dpl_enabled:-\]\|\[-readout_cfg_uri:-\]\|\[-qc_config_uri:-\]|\[-pdp_config_option:-\]|\[-pdp_o2_data_processing_hash:-\]|\[-pdp_topology_description_library_file:-\]|\[-pdp_workflow_name:-\]|\[-pdp_o2_data_processing_path:-\]
jobs:
directories-check:
name: Checks no changes are done to fix variables in workflows or tasks directory
runs-on: macOS-latest
env:
RESULT_WORKFLOWS: ''
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
path: ControlWorkflows
- run: (echo "Changes are coming from commit ${{ github.event.pull_request.base.sha }} ")
- run: (echo "Checks will be ran against commit ${{ github.sha }}")
- name: Run GUI variables checks for differences
working-directory: ./ControlWorkflows
run: |
git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -U0 --word-diff > workflow_changes.txt
RESULT_WORKFLOWS=$(grep "${{env.LIST_OF_VARIABLES}}" workflow_changes.txt) || true
# grep command returns exit code != 0 if it fails to find a match, thus we use || true
if [ -z "$RESULT_WORKFLOWS" ];
then
echo "WORKFLOWS/TASKS folder did not find any breaking changes"
else
echo "------------------"
echo "Identified keys that were changed:"
echo $RESULT_WORKFLOWS
echo "------------------"
echo "WORKFLOWS/TASKS folder found breaking changes. Please inform GUI Developer"
exit 1
fi