Update python-sdk SDK #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update python SDK | |
| on: | |
| # Çàïóñêàòèìåòüñÿ ùîíåä³ë³ îï³âíî÷³ (UTC) | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update_python_sdk: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1. Çàâàíòàæèòè âåñü ðåïîçèòîð³é (full history, ùîá ìàòè ìîæëèâ³ñòü pull/rebase) | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # 2. Çàâàíòàæèòè àðõ³â ³ç Python SDK | |
| - name: Download python.tgz | |
| run: | | |
| curl -L -o python.tgz https://app.api2cart.com/sdk/openapi/python.tgz | |
| # 3. Ðîçïàêóâàòè â êîð³íü ðåïîçèòîð³þ (âèäàëÿþ÷è 1 ð³âåíü ïàïîê "python/") | |
| - name: Extract python.tgz | |
| run: | | |
| tar -xzf python.tgz --strip-components=1 | |
| # 4. ϳäòÿãóºìî îñòàíí³ çì³íè ç â³ääàëåíîãî ðåïîçèòîð³þ, ùîá óíèêíóòè êîíôë³êò³â ïðè ïóø³ | |
| - name: Pull latest changes | |
| run: | | |
| git config user.name "GitHub Action" | |
| git config user.email "action@github.com" | |
| git pull --rebase origin main | |
| # 5. Êîì³òèìî ³ ïóøèìî îíîâëåíèé âì³ñò | |
| - name: Commit and push changes | |
| run: | | |
| git add . | |
| git diff-index --quiet HEAD || git commit -m "Update python SDK [skip ci]" | |
| git push origin HEAD:main |