From dd9f101c40cc8a05717b0a2c9e1f73291eb3c59d Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sun, 4 May 2025 16:47:11 +0300 Subject: [PATCH] fixup workflows Signed-off-by: Vasiliy Tolstov --- .github/workflows/job_coverage.yml | 3 +-- .github/workflows/job_lint.yml | 2 +- .github/workflows/job_sync.yml | 24 ++++++++---------------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/job_coverage.yml b/.github/workflows/job_coverage.yml index 4317367..3238e77 100644 --- a/.github/workflows/job_coverage.yml +++ b/.github/workflows/job_coverage.yml @@ -8,12 +8,11 @@ on: - '.gitea/**' pull_request: branches: [ main, v3, v4 ] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: jobs: build: + if: github.server_url != 'https://github.com' runs-on: ubuntu-latest steps: - name: checkout code diff --git a/.github/workflows/job_lint.yml b/.github/workflows/job_lint.yml index fdba6d8..1c104db 100644 --- a/.github/workflows/job_lint.yml +++ b/.github/workflows/job_lint.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-go@v5 with: cache-dependency-path: "**/*.sum" - go-version: 'stable' + go-version: 'stable' - name: setup deps run: go get -v ./... - name: run lint diff --git a/.github/workflows/job_sync.yml b/.github/workflows/job_sync.yml index 7f4af85..d0f7aa1 100644 --- a/.github/workflows/job_sync.yml +++ b/.github/workflows/job_sync.yml @@ -3,58 +3,50 @@ name: sync on: schedule: - cron: '*/5 * * * *' - push: - branches: [ master, v3, v4 ] - paths-ignore: - - '.github/**' - - '.gitea/**' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: sync: - if: env.GITHUB_ACTION == 0 + if: github.server_url != 'https://github.com' runs-on: ubuntu-latest steps: - name: init run: | git config --global user.email "vtolstov " git config --global user.name "github-actions[bot]" - echo "machine git.unistack.org login vtolstov password ${{ secrets.TOKEN_GITEA }}" | tee -a /root/.netrc - echo "machine github.com login vtolstov password ${{ secrets.TOKEN_GITHUB }}" | tee -a /root/.netrc + echo "machine git.unistack.org login vtolstov password ${{ secrets.TOKEN_GITEA }}" >> /root/.netrc + echo "machine github.com login vtolstov password ${{ secrets.TOKEN_GITHUB }}" >> /root/.netrc - name: sync master run: | - git clone --depth=10 --branch master --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo + git clone --filter=blob:none --filter=tree:0 --branch master --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo cd repo git remote add --no-tags --fetch --track master upstream https://github.com/${GITHUB_REPOSITORY} git pull --rebase upstream master git push upstream master --progress - git merge --allow-unrelated-histories "upstream/master" git push origin master --progress cd ../ rm -rf repo - name: sync v3 run: | - git clone --depth=10 --branch v3 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo + git clone --filter=blob:none --filter=tree:0 --branch v3 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo cd repo git remote add --no-tags --fetch --track v3 upstream https://github.com/${GITHUB_REPOSITORY} git pull --rebase upstream v3 - git push upstream v3 - git merge --allow-unrelated-histories "upstream/v3" + git push upstream v3 --progress git push origin v3 --progress cd ../ rm -rf repo - name: sync v4 run: | - git clone --depth=10 --branch v4 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo + git clone --filter=blob:none --filter=tree:0 --branch v4 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo cd repo git remote add --no-tags --fetch --track v4 upstream https://github.com/${GITHUB_REPOSITORY} git pull --rebase upstream v4 - git push upstream v4 - git merge --allow-unrelated-histories "upstream/v4" + git push upstream v4 --progress git push origin v4 --progress cd ../ rm -rf repo