-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.6 KB
/
Copy pathjob_alerts.yml
File metadata and controls
57 lines (47 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Job Alert Pipeline
on:
# schedule:
# # Run every 3 days at midnight
# - cron: '0 0 */3 * *'
# Allow manual triggering
workflow_dispatch:
jobs:
run-pipeline:
runs-on: ubuntu-latest
permissions:
contents: write # Important: Required to push updates back to the repo
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Job Alert Script
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
JOB_API_KEY: ${{ secrets.JOB_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
run: |
python main.py
- name: Commit and Push Updated State
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# touch file to ensure it exists and can be added even if script failed to run properly
touch seen_jobs.txt
git add seen_jobs.txt
# Only commit and push if there are changes
if ! git diff-index --quiet HEAD; then
git commit -m "chore: update seen_jobs.txt [skip ci]"
git push
else
echo "No new jobs found. Skipping commit."
fi