From 727a71bd6e6ef87aaba74a5175c219539719c379 Mon Sep 17 00:00:00 2001 From: Victor Vargas Date: Sun, 2 Aug 2026 23:21:04 -0700 Subject: [PATCH] fix(ci): use git clone instead of actions/checkout for Forgejo runner --- .forgejo/workflows/bump-version.yml | 20 +++++++++++++------- .forgejo/workflows/release.yml | 14 ++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/bump-version.yml b/.forgejo/workflows/bump-version.yml index 96a632b..f13ae99 100644 --- a/.forgejo/workflows/bump-version.yml +++ b/.forgejo/workflows/bump-version.yml @@ -14,10 +14,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.FORGEJO_TOKEN }} + env: + FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} + run: | + set -euo pipefail + HOST=${GITHUB_SERVER_URL#http://} + git clone "http://x-access-token:${FORGEJO_TOKEN}@${HOST}/${GITHUB_REPOSITORY}.git" . + git checkout "$GITHUB_SHA" + git config user.name "forgejo-actions[bot]" + git config user.email "forgejo-actions[bot]@noreply.local" - name: Skip if latest commit is already a release commit run: | @@ -59,11 +64,12 @@ jobs: echo "Bumping $CURRENT → $NEXT" - name: Update VERSION and push bump commit + env: + FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} run: | NEXT="${{ steps.next.outputs.next }}" printf '%s\n' "$NEXT" > VERSION - git config user.name "forgejo-actions[bot]" - git config user.email "forgejo-actions[bot]@noreply.${FORGEJO_DOMAIN:-src.sersofts.org}" git add VERSION git commit -m "chore(release): bump version to $NEXT" - git push origin HEAD:main + HOST=${GITHUB_SERVER_URL#http://} + git push "http://x-access-token:${FORGEJO_TOKEN}@${HOST}/${GITHUB_REPOSITORY}.git" HEAD:main diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index ee7de9c..9a9b846 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -34,16 +34,18 @@ jobs: ext: '.exe' steps: - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.FORGEJO_TOKEN }} + env: + FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} + run: | + set -euo pipefail + HOST=${GITHUB_SERVER_URL#http://} + git clone "http://x-access-token:${FORGEJO_TOKEN}@${HOST}/${GITHUB_REPOSITORY}.git" . + git checkout "$GITHUB_SHA" - name: Setup Go - uses: actions/setup-go@v5 + uses: https://code.forgejo.org/actions/setup-go@v5 with: go-version: '1.26' - cache: true - name: Build binary env: