diff --git a/.github/workflows/sync-to-forgejo.yml b/.github/workflows/sync-to-forgejo.yml index 07b6182..292a468 100644 --- a/.github/workflows/sync-to-forgejo.yml +++ b/.github/workflows/sync-to-forgejo.yml @@ -36,3 +36,16 @@ jobs: 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 + + - name: Trigger Forgejo Actions + env: + FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} + run: | + set -euo pipefail + # Trigger workflow dispatch via Forgejo API + BRANCH="${GITHUB_REF#refs/heads/}" + curl -s -X POST \ + -H "Authorization: token ${FORGEJO_TOKEN}" \ + -H "Content-Type: application/json" \ + "https://ci.nxtgauge.com/api/v1/repos/ashwin/${{ github.event.repository.name }}/actions/workflows/dispatches" \ + -d "{\"ref\":\"${BRANCH}\"}" || echo "Workflow trigger attempted"