ci: add Forgejo Actions trigger after push
This commit is contained in:
parent
6fbafa1cba
commit
423047f8c9
1 changed files with 13 additions and 0 deletions
13
.github/workflows/sync-to-forgejo.yml
vendored
13
.github/workflows/sync-to-forgejo.yml
vendored
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue