Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

Workflows: no GitHub import token; the Live test and the import campaign import token-free

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R3J2i3cD96PEceUzqjks8
Claude authored signed1 parent 2fabb8ecommit b268bce4398ccbd71bcd1b7837705495ddf7eebeBrowse files
2 files changed+6−26
modified.github/workflows/import-campaign.yml+4−23View file
@@ -5,10 +5,8 @@
55 # came across and what ran (scripts/import-campaign.sh). Started by hand.
66 #
77 # Dispatched on GitHub, it starts the same workflow on Diffinery and prints its report;
8-# on Diffinery it does the work. Imports use the IMPORT_GITHUB_TOKEN secret when it is
9-# set (a read-only token for public repositories), otherwise GitHub's anonymous rate
10-# limit applies and large repositories take hours. Set on GitHub, it is copied to
11-# Diffinery's repository secrets before the run starts (the main sync doesn't copy it).
8+# on Diffinery it does the work. Imports run token-free (Diffinery keeps no GitHub
9+# credentials), so GitHub's anonymous rate limit applies and large repositories take hours.
1210 on:
1311 workflow_dispatch:
1412 inputs:
@@ -68,18 +66,6 @@
6866 TOKEN: ${{ secrets.DIFFINERY_LIVE_TOKEN }}
6967 R: codician/diffinery
7068 steps:
71- - name: Copy IMPORT_GITHUB_TOKEN to Diffinery
72- if: ${{ inputs.follow_run == '' && !inputs.peek && inputs.rerun_failed == '' && inputs.inspect_run == '' && inputs.push_test == '' }}
73- env:
74- IMPORT_GITHUB_TOKEN: ${{ secrets.IMPORT_GITHUB_TOKEN }}
75- run: |
76- set -euo pipefail
77- if [ -n "$IMPORT_GITHUB_TOKEN" ]; then
78- jq -n --arg v "$IMPORT_GITHUB_TOKEN" '{value: $v}' | curl -fsS --retry 4 --retry-delay 30 -o /dev/null -X PUT "$DIFFINERY/api/v3/repos/$R/actions/secrets/IMPORT_GITHUB_TOKEN" -H "Authorization: Bearer $TOKEN" -H "content-type: application/json" --data-binary @-
79- echo "IMPORT_GITHUB_TOKEN is set on GitHub and was copied to Diffinery"
80- else
81- echo "IMPORT_GITHUB_TOKEN is not set on GitHub; Diffinery's own copy is used if it has one"
82- fi
8369 - name: Dispatch and follow
8470 env:
8571 REPOS: ${{ inputs.repos }}
@@ -229,12 +215,11 @@
229215 if: ${{ github.server_url != 'https://github.com' }}
230216 runs-on: ubuntu-latest
231217 timeout-minutes: 360
232- # DIFFINERY_LIVE_TOKEN and IMPORT_GITHUB_TOKEN are the production environment's.
218+ # DIFFINERY_LIVE_TOKEN is the production environment's.
233219 environment: production
234220 env:
235221 DIFFINERY: ${{ github.server_url }}
236222 TOKEN: ${{ secrets.DIFFINERY_LIVE_TOKEN }}
237- GITHUB_TOKEN_FOR_IMPORT: ${{ secrets.IMPORT_GITHUB_TOKEN }}
238223 steps:
239224 - uses: actions/checkout@v4
240225 - name: Import and run
@@ -243,11 +228,7 @@
243228 MINUTES: ${{ inputs.minutes }}
244229 RUN_WORKFLOWS: ${{ inputs.run_workflows }}
245230 run: |
246- if [ -n "$GITHUB_TOKEN_FOR_IMPORT" ]; then
247- echo "::notice::Mode: imports use the IMPORT_GITHUB_TOKEN secret"
248- else
249- echo "::warning::Mode: token-free. IMPORT_GITHUB_TOKEN is not set, so imports use GitHub's anonymous rate limit"
250- fi
231+ echo "::notice::Mode: token-free, so imports use GitHub's anonymous rate limit"
251232 # shellcheck disable=SC2086
252233 REPORT=report.md scripts/import-campaign.sh $REPOS
253234 cat report.md >> "$GITHUB_STEP_SUMMARY"
modified.github/workflows/live-test.yml+2−3View file
@@ -705,15 +705,14 @@
705705 env:
706706 # A small public repository with issues and pull requests; a repository variable can change it.
707707 SOURCE: ${{ vars.LIVE_IMPORT_SOURCE || 'octocat/git-consortium' }}
708- # A read-only GitHub token (copied here by the sync), so GitHub's rate limit doesn't skip the check. Never printed.
709- GITHUB_TOKEN_FOR_IMPORT: ${{ secrets.IMPORT_GITHUB_TOKEN }}
708+ # Token-free: Diffinery keeps no GitHub credentials of its own (the importer takes a person's token when they import).
709+ GITHUB_TOKEN_FOR_IMPORT: ""
710710 run: |
711711 set -euo pipefail
712712 api() { curl -fsS -X "$1" "$DIFFINERY/api/v3$2" -H "Authorization: Bearer $TOKEN" -H "content-type: application/json" ${3:+--data "$3"}; }
713713 name="$REPO-import"
714714 body=$(jq -nc --arg s "$SOURCE" --arg o "$OWNER" --arg n "$name" --arg t "${GITHUB_TOKEN_FOR_IMPORT:-}" \
715715 '{source: $s, owner: $o, name: $n, visibility: "private"} + (if $t == "" then {} else {github_token: $t} end)')
716- if [ -n "${GITHUB_TOKEN_FOR_IMPORT:-}" ]; then echo "importing with IMPORT_GITHUB_TOKEN"; else echo "::warning::IMPORT_GITHUB_TOKEN is not set, so the import runs token-free"; fi
717716 # Token-free, GitHub allows 60 requests an hour per address: a rate limit skips this check with a warning.
718717 # Starting the import reads the repository from GitHub; a GitHub outage (502 "could not reach GitHub")
719718 # is retried, and skips this check with a warning if it outlasts the retries. While other imports hold