diff --git a/.forgejo/workflows/bump-version.yml b/.forgejo/workflows/bump-version.yml index f13ae99..55cd548 100644 --- a/.forgejo/workflows/bump-version.yml +++ b/.forgejo/workflows/bump-version.yml @@ -5,6 +5,10 @@ on: branches: [main] workflow_dispatch: +env: + FORGEJO_HOST: src.sersofts.org + FORGEJO_PROTOCOL: https + concurrency: group: bump-version cancel-in-progress: false @@ -18,8 +22,7 @@ jobs: 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 clone "${FORGEJO_PROTOCOL}://x-access-token:${FORGEJO_TOKEN}@${FORGEJO_HOST}/${GITHUB_REPOSITORY}.git" . git checkout "$GITHUB_SHA" git config user.name "forgejo-actions[bot]" git config user.email "forgejo-actions[bot]@noreply.local" @@ -71,5 +74,4 @@ jobs: printf '%s\n' "$NEXT" > VERSION git add VERSION git commit -m "chore(release): bump version to $NEXT" - HOST=${GITHUB_SERVER_URL#http://} - git push "http://x-access-token:${FORGEJO_TOKEN}@${HOST}/${GITHUB_REPOSITORY}.git" HEAD:main + git push "${FORGEJO_PROTOCOL}://x-access-token:${FORGEJO_TOKEN}@${FORGEJO_HOST}/${GITHUB_REPOSITORY}.git" HEAD:main diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 9a9b846..059d0d5 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -6,6 +6,10 @@ on: - 'v*.*.*' - 'v*.*.*-*' +env: + FORGEJO_HOST: src.sersofts.org + FORGEJO_PROTOCOL: https + jobs: build: name: Build (${{ matrix.os }}/${{ matrix.arch }}) @@ -38,12 +42,11 @@ jobs: 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 clone "${FORGEJO_PROTOCOL}://x-access-token:${FORGEJO_TOKEN}@${FORGEJO_HOST}/${GITHUB_REPOSITORY}.git" . git checkout "$GITHUB_SHA" - name: Setup Go - uses: https://code.forgejo.org/actions/setup-go@v5 + uses: https://code.forgejo.org/actions/setup-go@v7 with: go-version: '1.26' @@ -94,7 +97,7 @@ jobs: - name: Create Forgejo release uses: https://code.forgejo.org/actions/forgejo-release@v2 with: - url: ${{ github.server_url }} + url: ${{ env.FORGEJO_PROTOCOL }}://${{ env.FORGEJO_HOST }} token: ${{ secrets.FORGEJO_TOKEN }} tag: ${{ github.ref_name }} release-dir: release diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 3c86214..9bc8efe 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa06a32..f75fdb6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,12 +37,12 @@ jobs: ext: '.exe' steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v7 with: go-version: '1.26' cache: true