diff --git a/.github/workflows/sync-archive-to-main.yml b/.github/workflows/sync-archive-to-main.yml index 304595e..7fe2fd6 100644 --- a/.github/workflows/sync-archive-to-main.yml +++ b/.github/workflows/sync-archive-to-main.yml @@ -12,8 +12,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Set up Git run: | @@ -41,11 +39,12 @@ jobs: git add -A git commit --allow-empty -am "Sync files from archive branch (excluding .xz files)" + git log if git diff --quiet HEAD main; then echo "branch_name=" >> $GITHUB_ENV else - git push origin $BRANCH_NAME + git push --set-upstream origin $BRANCH_NAME echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV fi