From 809e6ce852f5bc924eaad4337fed7e041fe5030a Mon Sep 17 00:00:00 2001 From: Pratham Dubey <134331217+prathamdby@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:42:08 +0530 Subject: [PATCH 1/4] Fixup the Add License workflow --- .github/workflows/add-license.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/add-license.yml b/.github/workflows/add-license.yml index cabb406..cbd7229 100644 --- a/.github/workflows/add-license.yml +++ b/.github/workflows/add-license.yml @@ -23,22 +23,20 @@ jobs: - name: Add License run: | - python scripts/add_license.py - - - name: Check for file changes - id: changes - run: | - if [ -n "$(git status --porcelain)" ]; then - echo "::set-output name=changes::true" + output=$(python scripts/add_license.py) || "" + echo "$output" + if echo "$output" | grep -q "added"; then + echo "::set-output name=added_license::true" else - echo "::set-output name=changes::false" + echo "::set-output name=added_license::false" fi + id: add_license - name: Commit changes - if: steps.changes.outputs.changes == true + if: steps.add_license.outputs.added_license == true run: | git config --global user.name "GitHub Actions Bot" git config --global user.email "actions@github.com" - git add . + git add --all git commit -m "Add license to files" git push From 65dca0d5abb492f8845d5b8f1054b4c8d666fb85 Mon Sep 17 00:00:00 2001 From: Pratham Dubey <134331217+prathamdby@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:43:44 +0530 Subject: [PATCH 2/4] Downgrade the python-version in the Add License workflow Make the python-version match the pyproject.toml. --- .github/workflows/add-license.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add-license.yml b/.github/workflows/add-license.yml index cbd7229..055c955 100644 --- a/.github/workflows/add-license.yml +++ b/.github/workflows/add-license.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.10" - name: Add License run: | From 7109f183af1cc4f382dc673f19503279aafe6a0b Mon Sep 17 00:00:00 2001 From: Pratham Dubey <134331217+prathamdby@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:45:17 +0530 Subject: [PATCH 3/4] Switch to dependency-only mode for poetry --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index ea3e26f..d48a339 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,7 @@ description = "A Telegram chat bot with support for multiple LLMs!" authors = ["YeetCode Developers "] license = "GPL-3.0-only" readme = "README.md" +package-mode = false [tool.poetry.dependencies] python = "^3.10" From 80e209813b7c959f6bee248541663c3f8f08b707 Mon Sep 17 00:00:00 2001 From: Pratham Dubey <134331217+prathamdby@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:51:19 +0530 Subject: [PATCH 4/4] Update the deprecated state functions in the Add License workflow --- .github/workflows/add-license.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add-license.yml b/.github/workflows/add-license.yml index 055c955..c040afc 100644 --- a/.github/workflows/add-license.yml +++ b/.github/workflows/add-license.yml @@ -26,9 +26,9 @@ jobs: output=$(python scripts/add_license.py) || "" echo "$output" if echo "$output" | grep -q "added"; then - echo "::set-output name=added_license::true" + echo "added_license=true" >> $GITHUB_OUTPUT else - echo "::set-output name=added_license::false" + echo "added_license=false" >> $GITHUB_OUTPUT fi id: add_license