diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index 41394dd..0000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,24 +0,0 @@ -# https://docs.astral.sh/ruff -name: ci -on: - push: - # branches: [main] - pull_request: - branches: [main] - workflow_dispatch: -jobs: - codespell: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - run: pipx run codespell - ruff_check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - run: pipx run ruff check --output-format=github - ruff_format: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - run: pipx run ruff format diff --git a/.github/workflows/auto-reply.yml b/.github/workflows/auto-reply.yml deleted file mode 100644 index 5089dec..0000000 --- a/.github/workflows/auto-reply.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: šŸ¤– Auto-Reply to Issues - -on: - issues: - types: [opened] - -permissions: - issues: write - -jobs: - auto-comment: - runs-on: ubuntu-latest - - steps: - - name: Comment on new issue - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const issueNumber = context.issue.number; - const username = context.payload.issue.user.login; - const comment = [ - `šŸ‘‹ Hello @${username}, thank you for opening an issue!`, - ``, - `I will get back to you as soon as i can. - 1501henify`, - ``, - `We appreciate your input — Have a great day/night!` - ].join('\n'); - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issueNumber, - body: comment - }); diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index 4132681..0000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: šŸ–¤ Black Formatter - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - format: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - name: Install Black - run: pip install black - - - name: Run Black - run: black . diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..0097caf --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,115 @@ +name: šŸš€ CI + CD Pipeline + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + schedule: + - cron: '0 0 * * *' # Daily at midnight for README updates + +permissions: + contents: write + issues: write + +jobs: + # Code Quality Checks + code-quality: + runs-on: ubuntu-latest + name: šŸ” Code Quality + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - name: Run Codespell + run: pipx run codespell + continue-on-error: true + + - name: Run Ruff Check + run: pipx run ruff check --output-format=github + continue-on-error: true + + - name: Run Ruff Format + run: pipx run ruff format + continue-on-error: true + + - name: Install Black + run: pip install black + + - name: Run Black Formatter + run: black . + continue-on-error: true + + # Update README Statistics + update-readme: + runs-on: ubuntu-latest + name: 🧠 Update README Stats + if: github.event_name == 'push' || github.event_name == 'schedule' + needs: code-quality + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Count Python files and lines + run: | + PY_FILES=$(find . -name "*.py" | wc -l) + TOTAL_LINES=$(find . -name "*.py" -exec cat {} + | wc -l) + echo "PY_FILES=$PY_FILES" >> $GITHUB_ENV + echo "TOTAL_LINES=$TOTAL_LINES" >> $GITHUB_ENV + + - name: Update README.md + run: | + STATS="šŸ“„ Total lines of code: $TOTAL_LINES\nšŸ Number of Python files: $PY_FILES" + DATE="šŸ•’ Last updated: $(date -u +"%Y-%m-%d %H:%M UTC")" + + sed -i "//,//c\\\n$STATS\n" README.md + sed -i "//,//c\\\n$DATE\n" README.md + + - name: Commit changes + run: | + git config --global user.name "GitHub Actions Bot" + git config --global user.email "actions@github.com" + git add README.md + if git diff --staged --quiet; then + echo "No changes to commit" + else + git commit -m "🧠 Update README stats" + git push + fi + + # Auto-reply to new issues + auto-reply: + runs-on: ubuntu-latest + name: šŸ¤– Auto-Reply + if: github.event_name == 'issues' && github.event.action == 'opened' + + steps: + - name: Comment on new issue + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issueNumber = context.issue.number; + const username = context.payload.issue.user.login; + const comment = [ + `šŸ‘‹ Hello @${username}, thank you for opening an issue!`, + ``, + `I will get back to you as soon as I can. - 1501henify`, + ``, + `We appreciate your input — Have a great day/night!` + ].join('\n'); + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + body: comment + }); diff --git a/.github/workflows/updated-readme.yml b/.github/workflows/updated-readme.yml deleted file mode 100644 index cda3cb6..0000000 --- a/.github/workflows/updated-readme.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: 🧠 Update README Stats - -on: - push: - branches: [main] - schedule: - - cron: '0 0 * * *' # Every day at midnight - -jobs: - update-readme: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Count Python files and lines - run: | - PY_FILES=$(find . -name "*.py" | wc -l) - TOTAL_LINES=$(find . -name "*.py" -exec cat {} + | wc -l) - echo "PY_FILES=$PY_FILES" >> $GITHUB_ENV - echo "TOTAL_LINES=$TOTAL_LINES" >> $GITHUB_ENV - - - name: Update README.md - run: | - STATS="šŸ“„ Total lines of code: $TOTAL_LINES\nšŸ Number of Python files: $PY_FILES" - DATE="šŸ•’ Last updated: $(date -u +"%Y-%m-%d %H:%M UTC")" - - sed -i "//,//c\\\n$STATS\n" README.md - sed -i "//,//c\\\n$DATE\n" README.md - - - name: Commit changes - run: | - git config --global user.name "GitHub Actions Bot" - git config --global user.email "actions@github.com" - git add README.md - git commit -m "🧠 Update README stats" - git push diff --git a/README.md b/README.md index 3d127d4..f0a7777 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ Each one is a small step toward becoming a full-stack developer. ✨ **Day 11 of Learning Python** ✨ -šŸ“„ Total lines of code: 328 +šŸ“„ Total lines of code: 329 šŸ Number of Python files: 22 -šŸ•’ Last updated: 2025-10-28 01:51 UTC +šŸ•’ Last updated: 2025-11-20 02:02 UTC diff --git a/practie problems/solve_10.py b/practie problems/solve_10.py index ca76cb0..4304361 100644 --- a/practie problems/solve_10.py +++ b/practie problems/solve_10.py @@ -1,7 +1,7 @@ -##### PROJECT 1 ####### +##### PROJECT No.1 ####### ##Write a program that accepts an input from a user about their birth year ##Write an output telling the user his/her age depending on the information provided by the user -user_birthYear = int(input("What's your birth year: ")) +user_birthYear = int(input("What is your birth year: ")) year_Const = 2025 -print(f"You're {year_Const - user_birthYear} years old.") \ No newline at end of file +print(f"You are {year_Const - user_birthYear} years old.")