From 6b386ffa3dbdfa192e77a726f01475208852807e Mon Sep 17 00:00:00 2001 From: zevisvei <101482799+zevisvei@users.noreply.github.com> Date: Mon, 7 Oct 2024 05:55:15 +0300 Subject: [PATCH 1/2] Create monthly_update.yml --- .github/workflows/monthly_update.yml | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/monthly_update.yml diff --git a/.github/workflows/monthly_update.yml b/.github/workflows/monthly_update.yml new file mode 100644 index 000000000..832621935 --- /dev/null +++ b/.github/workflows/monthly_update.yml @@ -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@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + 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 From 733f6dab9dcaab773e2828ac6ed5b252878f637a Mon Sep 17 00:00:00 2001 From: zevisvei <101482799+zevisvei@users.noreply.github.com> Date: Mon, 7 Oct 2024 22:32:24 +0300 Subject: [PATCH 2/2] Update monthly_update.yml --- .github/workflows/monthly_update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/monthly_update.yml b/.github/workflows/monthly_update.yml index 832621935..069973e6c 100644 --- a/.github/workflows/monthly_update.yml +++ b/.github/workflows/monthly_update.yml @@ -11,10 +11,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.12'