Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the Add License workflow, match the python-version with the project, and switch to dependency-only mode for poetry #9

Closed
wants to merge 7 commits into from
22 changes: 6 additions & 16 deletions .github/workflows/add-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Add License
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

Expand All @@ -19,26 +17,18 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "[email protected]"
git add .
git commit -m "Add license to files"
git push
git add --all
git commit -m "Add license to files" || echo "No changes to commit"
git push origin HEAD:main
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description = "A Telegram chat bot with support for multiple LLMs!"
authors = ["YeetCode Developers <[email protected]>"]
license = "GPL-3.0-only"
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.10"
Expand Down