-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.7 KB
/
main.yml
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
58
59
60
61
name: Update Versions
on:
schedule:
- cron: '0 0 * * *' # Run every day at midnight
workflow_dispatch: # Enables manual triggering
jobs:
update_versions:
runs-on: ubuntu-latest
steps:
# Check out the repository
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for accurate git operations
# Set up Python 3.9
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
# Install dependencies
- name: Install dependencies
run: |
pip install requests beautifulsoup4
# Run the version update scripts
- name: Run Firefox version script
run: python firefox/get_firefox_versions.py
- name: Run Chrome version script
run: python chrome/get_chrome_versions.py
- name: Run Windows version script
run: python windows/get_windows_versions.py
# Configure Git
- name: Configure Git
run: |
git config user.name "AmineHazi"
git config user.email "aminehazi03@gmail.com"
# Add modified files
- name: Add modified files
run: |
git add firefox/versions/ chrome/versions/ windows/versions/
# Commit and push changes if there are any
- name: Commit and push changes
env:
PAT_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
if ! git diff --cached --quiet; then
git commit -m "Update versions [skip ci]"
git push https://AmineHazi:${PAT_TOKEN}@github.com/Galeax/PackageVersionDate.git HEAD:main
else
echo "No changes to commit."
fi