Update diffs for rohittp0/AutoREPL at Fri Apr 12 00:40:09 UTC 2024 #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
- name: Notify Slack | |
run: | | |
curl -X POST -H 'Content-type: application/json' -d @slack.json ${{ secrets.SLACK_WEBHOOK_URL }} | |
- 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 |