reuse-surface/.forgejo/workflows/recompose-fallback.yaml

30 lines
1 KiB
YAML
Raw Normal View History

# Scheduled fallback recompose trigger (REUSE-WP-0019-T03 design principle 3:
# "degrade to schedule" if the org-level webhook is unavailable or misses an
# event). The webhook (POST /v1/webhooks/forgejo) is the primary path; this
# just guarantees the hub's composed index doesn't go stale indefinitely if a
# webhook delivery is ever missed.
name: Recompose Fallback
on:
schedule:
- cron: "17 */6 * * *"
workflow_dispatch:
jobs:
recompose:
runs-on: ubuntu-latest
steps:
- name: Trigger hub recompose
env:
REUSE_SURFACE_TOKEN: ${{ secrets.REUSE_SURFACE_TOKEN }}
run: |
set -eu
apt-get update -qq
apt-get install -y -qq curl >/dev/null
status=$(curl -sS -o /tmp/compose.json -w '%{http_code}' \
-X POST "https://reuse.coulomb.social/v1/federated/compose" \
-H "Authorization: Bearer ${REUSE_SURFACE_TOKEN}")
echo "status=${status}"
cat /tmp/compose.json
[ "${status}" = "200" ]