-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 2 KB
/
label_export.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
50
51
52
53
54
55
56
57
58
59
60
61
name: Export labels
on:
push:
branches:
- main
paths:
- ".github/workflows/label_export.yml"
- "label_export/export_annotations.py"
- "label_export/requirements.txt"
pull_request:
paths:
- ".github/workflows/label_export.yml"
- "label_export/export_annotations.py"
- "label_export/requirements.txt"
# Also run on a schedule, running every sunday at 03:00
schedule:
- cron: "0 3 * * 0"
# Also run on a manual trigger
workflow_dispatch:
jobs:
export_labels:
runs-on: ubuntu-latest
name: Export labels
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt
working-directory: ./label_export
- name: Export labels with children
run: python ./export_annotations.py --annotations-csv=False --annotations-json=../json_files/annotations_with_children.json --fetch-children=True
working-directory: ./label_export
- name: Export labels without children
run: python ./export_annotations.py --annotations-csv=False --annotations-json=../json_files/annotations.json --fetch-children=False
working-directory: ./label_export
- name: Upload labels JSON
uses: actions/upload-artifact@v4.3.4
with:
name: labels
path: ./json_files/annotations.json
- name: Upload labels with children JSON
uses: actions/upload-artifact@v4.3.4
with:
name: labels_with_children
path: ./json_files/annotations_with_children.json
- name: Commit and push changes
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Exported labels"
permissions:
contents: write