ci: add manual sync-from-upstream workflow
This commit is contained in:
parent
b32d4f0c45
commit
23004a1d7d
1 changed files with 34 additions and 0 deletions
34
.gitea/workflows/sync-upstream.yml
Normal file
34
.gitea/workflows/sync-upstream.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
name: Sync from upstream
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync:
|
||||||
|
runs-on: [self-hosted-ubuntu]
|
||||||
|
timeout-minutes: 120
|
||||||
|
steps:
|
||||||
|
- name: Mirror-fetch from upstream and push here
|
||||||
|
run: |
|
||||||
|
# Manual-only trigger is load-bearing: this repo exists
|
||||||
|
# specifically so chromium-fork's CI never talks to
|
||||||
|
# https://chromium.googlesource.com/external/github.com/llvm/llvm-project directly (see chromium-fork's ci.yml
|
||||||
|
# url.insteadOf rewrite). Upstream only gets contacted when a
|
||||||
|
# human explicitly runs this.
|
||||||
|
set -e
|
||||||
|
WORK_DIR="$(mktemp -d)"
|
||||||
|
cd "$WORK_DIR"
|
||||||
|
|
||||||
|
git clone --mirror \
|
||||||
|
https://chromium.googlesource.com/external/github.com/llvm/llvm-project \
|
||||||
|
upstream.git
|
||||||
|
|
||||||
|
SERVER_HOST="${{ github.server_url }}"
|
||||||
|
SERVER_HOST="${SERVER_HOST#https://}"
|
||||||
|
REPO_URL="https://x-access-token:${{ secrets.GITHUB_TOKEN }}@${SERVER_HOST}/${{ github.repository }}.git"
|
||||||
|
|
||||||
|
cd upstream.git
|
||||||
|
git push --mirror "$REPO_URL"
|
||||||
|
|
||||||
|
cd "$WORK_DIR"
|
||||||
|
rm -rf upstream.git
|
||||||
Loading…
Reference in a new issue