diff --git a/.github/actions/gitPush/action.yaml b/.github/actions/gitPush/action.yaml index cb3b16e..52b5dc2 100644 --- a/.github/actions/gitPush/action.yaml +++ b/.github/actions/gitPush/action.yaml @@ -5,10 +5,16 @@ runs: shell: bash run: | timestamp=`date "+%Y.%m.%d %H:%M:%S"` + daily_branch=`date "+%Y%m%d"` git config --global user.name "${{ env.REPO_OWNER }}" git config --global user.email "${{ env.REPO_OWNER }}@github.com" git add ${{ env.PUSH_FILES }} git diff --staged --quiet || CHANGED=true + if [ -n "${{ env.CUSTOM_BRANCH }}" ]; then + git checkout "${daily_branch}" 2>/dev/null || git checkout -b "${daily_branch}" + git pull origin "${daily_branch}" + git push --set origin "${daily_branch}" + fi if [ "$CHANGED" = true ]; then git commit -m "Update $timestamp" git push https://${{ env.GH_PAT }}@github.com/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}.git diff --git a/.github/workflows/update_ru_all_lists.yml b/.github/workflows/update_ru_all_lists.yml index 651958f..84b9361 100644 --- a/.github/workflows/update_ru_all_lists.yml +++ b/.github/workflows/update_ru_all_lists.yml @@ -30,3 +30,4 @@ jobs: - uses: ./.github/actions/gitPush env: PUSH_FILES: auto/*txt + CUSTOM_BRANCH: true