From b03255a704b688a5944dc6fbf489ffdfb29df00f Mon Sep 17 00:00:00 2001 From: Nikita Panyuhin Date: Sun, 21 Jan 2024 23:52:12 +0300 Subject: [PATCH] Refactoring --- .github/workflows/daily_update.yml | 3 ++- .github/workflows/lint.yaml | 4 ++-- src/.gitignore | 3 +++ src/scripts/bulk_cloudflare_upload.py | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/daily_update.yml b/.github/workflows/daily_update.yml index 50673b61..50ac45a1 100644 --- a/.github/workflows/daily_update.yml +++ b/.github/workflows/daily_update.yml @@ -15,6 +15,7 @@ jobs: update-images: name: Update images runs-on: ubuntu-latest + steps: - name: Clone repository uses: actions/checkout@v4 @@ -22,7 +23,7 @@ jobs: token: ${{ secrets.GH_PAT }} - name: Install Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: 3.11 cache: pip diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 5a9db296..72b9e7de 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ permissions: contents: read jobs: - linter: + lint: name: Lint code runs-on: ubuntu-latest @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 cache: pip diff --git a/src/.gitignore b/src/.gitignore index 95dab6c7..e71b7ab9 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -8,3 +8,6 @@ website/* # Configuration files with tokens configs/*token.json + +# Temporary files +_temp/ diff --git a/src/scripts/bulk_cloudflare_upload.py b/src/scripts/bulk_cloudflare_upload.py index abe82300..52f00a18 100644 --- a/src/scripts/bulk_cloudflare_upload.py +++ b/src/scripts/bulk_cloudflare_upload.py @@ -5,7 +5,7 @@ from cloudflare import CloudflareR2 # noqa: E402 -def bulk_upload(root_path): +def main(root_path): storage = CloudflareR2() for root, dirs, files in os.walk(root_path): @@ -16,4 +16,4 @@ def bulk_upload(root_path): if __name__ == '__main__': - bulk_upload('../tmp/npanuhin-bing-wallpaper-archive') + main('../tmp/npanuhin-bing-wallpaper-archive')