diff --git a/.github/workflows/sync-to-forgejo.yml b/.github/workflows/sync-to-forgejo.yml index cf16b9c..07b6182 100644 --- a/.github/workflows/sync-to-forgejo.yml +++ b/.github/workflows/sync-to-forgejo.yml @@ -7,6 +7,13 @@ on: - high-performance workflow_dispatch: +permissions: + contents: read + +concurrency: + group: sync-to-forgejo-${{ github.ref }} + cancel-in-progress: true + jobs: sync: runs-on: ubuntu-latest @@ -26,11 +33,6 @@ jobs: FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} run: | set -euo pipefail - # Add Forgejo remote - git remote add forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/nxtgauge-frontend-solid.git" 2>/dev/null || \ - git remote set-url forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/nxtgauge-frontend-solid.git" - - # Push current branch to Forgejo - git push forgejo HEAD:${GITHUB_REF#refs/heads/} --force - - echo "✅ Successfully synced ${GITHUB_REF} to Forgejo" + git remote add forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/${{ github.event.repository.name }}.git" 2>/dev/null || \ + git remote set-url forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/${{ github.event.repository.name }}.git" + git push forgejo "HEAD:${GITHUB_REF#refs/heads/}" --force