-
Notifications
You must be signed in to change notification settings - Fork 11
57 lines (47 loc) · 1.55 KB
/
update_and_convert_schemas.yaml
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
name: Update schemas with changes
on:
push:
branches-ignore: ["main"]
jobs:
update-schemas-with-changes:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get complete history
- name: Get latest push changes
id: changed-files
# if: github.base_ref != 'main' && github.event.action == 'synchronize'
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in "$ALL_CHANGED_FILES"; do
echo "$file was changed"
done
- name: Install dependencies
run: pip install git+https://github.com/hed-standard/hed-python.git@develop
- name: Update schemas
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
hed_update_schemas $ALL_CHANGED_FILES
- name: Push schema changes
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add .
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "Automated schema changes"
git push
fi