Federated via graft
0

Configure Feed

Select the types of activity you want to include in your feed.

CI: notify admin via issue when GitHub push fails

+11
+11
.forgejo/workflows/push-github.yml
··· 15 15 cd /tmp/graft-mirror 16 16 git push "https://x-access-token:${{ secrets.GH_PUSH_TOKEN }}@github.com/jeanbaptiste/graft.git" main:main 17 17 rm -rf /tmp/graft-mirror 18 + - name: notify admin on failure 19 + if: failure() 20 + run: | 21 + BODY=$(python3 -c "import json; print(json.dumps({'title': 'CI: push to GitHub failed (run ${GITHUB_RUN_NUMBER})', 'body': 'push-github failed to mirror main to GitHub — most likely someone pushed directly to GitHub, causing a divergence a plain git push refuses to overwrite.\n\nResolve manually: compare https://github.com/jeanbaptiste/graft and https://f1.cyberwild.org/forgeadmin/graft/src/branch/main, reconcile, then push.\n\nRun: https://f1.cyberwild.org/forgeadmin/graft/actions/runs/${GITHUB_RUN_NUMBER}'}))") 22 + curl -s -X POST \ 23 + -H "Authorization: token ${{ secrets.F1_ISSUE_TOKEN }}" \ 24 + -H "Content-Type: application/json" \ 25 + --data "$BODY" \ 26 + "https://f1.cyberwild.org/api/v1/repos/forgeadmin/graft/issues" \ 27 + -o /tmp/issue-create-resp.json -w "issue create HTTP: %{http_code}\n" 28 + cat /tmp/issue-create-resp.json