Skip to content

Update 1.txt

Update 1.txt #13

Workflow file for this run

name: Python Script Runner
on:
push:
branches:
- "**"
paths:
- "diffs/**/*"
permissions:
contents: write
jobs:
run-python-script:
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.12'
- name: Cache Python dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
save-always: true
key: "${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}"
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run script
run: python main.py
env:
CURRENT_REPO_URL: "${{ github.server_url }}/${{ github.repository }}/blob/"
OPEN_AI_API_KEY: ${{ secrets.OPEN_AI_API_KEY }}
TELEGRAM_CHAT_ID: ${{ vars.TELEGRAM_CHAT_ID }}
- name: Commit and push changes
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Created Post"
git push
- name: Notify Slack
if: env.WEBHOOK_URL
run: |
curl -X POST -H 'Content-type: application/json' -d @slack.json ${{ secrets.SLACK_WEBHOOK_URL }}
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Notify Telegram
if: env.BOT_TOKEN
run: |
curl -X POST -H 'Content-type: application/json' -d @telegram.json https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage
env:
BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}