From 6b7cf1c11a368d1e409623bfcb7aa57c7fa7efbb 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 1/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 3afa839577fad5ccbc8d3978af3404e11655d6f1 Mon Sep 17 00:00:00 2001 From: Pratham Dubey <134331217+prathamdby@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:42:45 +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 cabb406..f5a75fa 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 0b78e05a8826552488df8bdc76673b62cefbe9e4 Mon Sep 17 00:00:00 2001 From: Pratham Dubey <134331217+prathamdby@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:47:25 +0530 Subject: [PATCH 3/4] Restrict the Add License to workflow to push events only --- .github/workflows/add-license.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/add-license.yml b/.github/workflows/add-license.yml index f5a75fa..cae78b9 100644 --- a/.github/workflows/add-license.yml +++ b/.github/workflows/add-license.yml @@ -3,8 +3,6 @@ name: Add License on: push: branches: [ main ] - pull_request: - branches: [ main ] jobs: From 691c7aced9d4b0e030fd95d03e0b0647ca553e4c Mon Sep 17 00:00:00 2001 From: Pratham Dubey <134331217+prathamdby@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:48:50 +0530 Subject: [PATCH 4/4] Migrate to the Git Commit Push Action step in the Add License workflow --- .github/workflows/add-license.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/add-license.yml b/.github/workflows/add-license.yml index cae78b9..8747cb9 100644 --- a/.github/workflows/add-license.yml +++ b/.github/workflows/add-license.yml @@ -13,30 +13,18 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # Required to retrieve full commit history + persist-credentials: false # Required to allow the use of the token to push back to the repository - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.10" - 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" - else - echo "::set-output name=changes::false" - fi - - - name: Commit changes - if: steps.changes.outputs.changes == true - run: | - git config --global user.name "GitHub Actions Bot" - git config --global user.email "actions@github.com" - git add . - git commit -m "Add license to files" - git push + - uses: GuillaumeFalourd/git-commit-push@v1.3 + with: + commit_message: "Add license to files" + target_branch: main