forked from anoma/namada-testnets
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.47 KB
/
validate-pregenesis.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
name: Validate pre-genesis files
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
GIT_LFS_SKIP_SMUDGE: 1
jobs:
check:
timeout-minutes: 30
runs-on: [ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check pre-genesis file validity
run: |
pip3 install toml
python3 .github/workflows/scripts/validate.py --folder $CHAIN_ID_FOLDER
env:
CHAIN_ID_FOLDER: ${{ vars.CHAIN_ID_FOLDER || 'namada-public-testnet-15' }}
- name: Check for 'update' in pull request name
run: |
pr_name=$(echo "${{ github.event.pull_request.title }}" | tr '[:upper:]' '[:lower:]')
if [[ "$pr_name" == *"update"* ]]; then
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
num_changed_files=$(echo "$changed_files" | wc -l)
if [ $num_changed_files -eq 1 ]; then
python3 .github/workflows/scripts/validate_previous_genesis.py --folder $CHAIN_ID_FOLDER --filename $changed_files
fi
fi
env:
CHAIN_ID_FOLDER: ${{ vars.CHAIN_ID_FOLDER || 'namada-public-testnet-15' }}