File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Mirror to forge.blacksky.community
2+
3+ on :
4+ push : {}
5+ workflow_dispatch : {}
6+
7+ permissions :
8+ contents : read
9+
10+ jobs :
11+ tangle :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0
17+ - name : push to forge knot
18+ env :
19+ TANGLED_KEY : ${{ secrets.TANGLED_KEY }}
20+ run : |
21+ set -euo pipefail
22+ mkdir -p ~/.ssh
23+ chmod 700 ~/.ssh
24+ printf '%s\n' "$TANGLED_KEY" > ~/.ssh/tangled_key
25+ chmod 600 ~/.ssh/tangled_key
26+ cat > ~/.ssh/config <<'EOF'
27+ Host knot.blacksky.community
28+ StrictHostKeyChecking no
29+ UserKnownHostsFile=/dev/null
30+ IdentityFile ~/.ssh/tangled_key
31+ IdentitiesOnly yes
32+ EOF
33+ chmod 600 ~/.ssh/config
34+
35+ # actions/checkout leaves origin branches under refs/remotes/origin/*
36+ # — git push --mirror would copy those as remote-tracking refs on
37+ # the destination instead of as proper branches. Materialize them
38+ # under refs/heads/* first so the mirror push lands them as real
39+ # branches that forge can render.
40+ #
41+ # Detach HEAD before fetching so the fetch can overwrite
42+ # refs/heads/<currently-checked-out-branch> without git refusing.
43+ git -c advice.detachedHead=false checkout --detach
44+ git fetch origin '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'
45+ git remote add tangled git@knot.blacksky.community:blackskyweb.xyz/rsky
46+ git push --mirror tangled
You can’t perform that action at this time.
0 commit comments