-
Notifications
You must be signed in to change notification settings - Fork 14
53 lines (46 loc) · 1.71 KB
/
scrape-errors.yml
File metadata and controls
53 lines (46 loc) · 1.71 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
name: Scrape Errors
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
jobs:
scrape_and_commit:
name: Scrape and Update Error Lists
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install Python dependencies and run scripts
run: |
set -e # Exit immediately if a command exits with a non-zero status
echo "-------------------- Installing dependencies --------------------"
cd compiler/errors/
python -m pip install --upgrade pip setuptools wheel
python -m pip install requests==2.28.1
echo "-------------------- Running scrape script --------------------"
python sort.py scrape
echo "-------------------- Running sort script --------------------"
python sort.py sort
- name: Check for changes and commit
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Actions Bot"
if ! git diff --quiet; then # Check if there are any changes
echo "Changes detected in error files."
git add .
git commit -m "Automated update of unknown_errors"
echo "Committing and pushing changes..."
git push origin main
else
echo "No changes detected in error files. Skipping commit and push."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}