-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.31 KB
/
listen-swagger-changes.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
name: "Check for new Swagger release 🕵️♂️"
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: "Check out repository 🚚"
uses: actions/checkout@v4
- name: "Print some debug info 🐞"
run: |
echo "Current directory: $(pwd)"
echo "Files in the current directory: $(ls)"
- name: "Set up Python 🐍"
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: "Install python libraries 📚"
run: python -m pip install requests
- name: "Check for new Swagger release 🕵️♂️"
working-directory: .
run: python check_swagger.py
# It will set SWAGGER_UI_UPDATED and SWAGGER_UI_VERSION env variables
# If there is a new release, then needed files will be updated
- name: "Make a commit if needed 📝"
run: |
if [ "$SWAGGER_UI_UPDATED" = "true" ]; then
git config --global user.email "ruslan.belckov@yandex.ru"
git config --global user.name "Automated Swagger UI update"
git add 'fastapi_swagger/resources'
git add 'latest_release.txt'
git commit -m "chore: update Swagger UI to $SWAGGER_UI_VERSION"
git push
fi