Diffinery

homeflare/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.

diffinery/.github/workflows/mirror-from-github.yml
42 lines · 1.5 KBRaw History
1name: Mirror from GitHub
2
3# Keeps diffinery.com/codician/diffinery in step with github.com/codician-team/diffinery,
4# where development happens, through scripts/mirror-from-github.sh: GitHub's main and tags
5# are copied as they are, and Diffinery runs CI on each copied commit. Runs on Diffinery
6# only. Uses DIFFINERY_MIRROR_TOKEN (a Diffinery token with the admin scope, of a person who
7# is an admin of codician/diffinery), a secret of the github-mirror environment. That
8# environment is limited to protected branches, so only main's runs get it. Without the
9# token the job says so and does nothing.
10on:
11 schedule:
12 - cron: "*/15 * * * *"
13 workflow_dispatch:
14
15permissions:
16 contents: read
17
18concurrency:
19 group: mirror-from-github
20 cancel-in-progress: false
21
22jobs:
23 mirror:
24 name: Copy GitHub's main to Diffinery
25 if: ${{ github.server_url != 'https://github.com' && github.repository == 'codician/diffinery' }}
26 runs-on: ${{ vars.DIFFINERY_RUNS_ON || 'ubuntu-latest' }}
27 environment: github-mirror
28 timeout-minutes: 10
29 env:
30 DIFFINERY_TOKEN: ${{ secrets.DIFFINERY_MIRROR_TOKEN }}
31 steps:
32 - name: Check the Diffinery token
33 id: token
34 run: |
35 if [ -z "$DIFFINERY_TOKEN" ]; then
36 echo "::notice::DIFFINERY_MIRROR_TOKEN is not set, so Diffinery is not updated."
37 echo "skip=true" >> "$GITHUB_OUTPUT"
38 fi
39 - uses: actions/checkout@v4
40 if: steps.token.outputs.skip != 'true'
41 - if: steps.token.outputs.skip != 'true'
42 run: scripts/mirror-from-github.sh