-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from zevisvei/main
Create monthly_update.yml
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Run code monthly | ||
|
||
on: | ||
schedule: | ||
- cron: '0 12 1 * *' # כל 1 לחודש בשעה 12:00 UTC | ||
workflow_dispatch: # אפשר להריץ את ה-workflow ידנית | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install bs4 | ||
pip install lxml | ||
pip install requests | ||
- name: Run script Ben-Yehuda | ||
run: python ben_y.py | ||
working-directory: Ben-YehudaToOtzaria/סקריפטים | ||
- name: Run script dicta | ||
run: python "all in one.py" | ||
working-directory: DictaToOtzaria/סקריפטים | ||
|
||
|
||
|
||
- name: Commit changes if any # שלב לדחיפת השינויים | ||
run: | | ||
git config --global user.name "${{ github.actor }}" | ||
git config --global user.email "${{ secrets.GITHUB_EMAIL }}" | ||
git add . # הוסף את כל השינויים | ||
if ! git diff-index --quiet HEAD --; then # בדוק אם יש שינויים | ||
git commit -m "Automated commit from GitHub Actions" # בצע commit אם יש שינויים | ||
git pull origin main --rebase | ||
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main | ||
else | ||
echo "No changes to commit." # אין שינויים | ||
fi |