Skip to content

Commit bcb0feb

Browse files
chore: mirror main and tags to sourcebot-private (#1611)
* chore: mirror main and tags to sourcebot-private * chore: update changelog for #1611 * chore: remove changelog entry * fix: mirror skip-ci release commits
1 parent 230d3c8 commit bcb0feb

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Mirror to sourcebot-private
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*"
9+
- "setup-sourcebot-v*"
10+
# Release commits use `[skip ci]`, which suppresses push-triggered workflows.
11+
workflow_run:
12+
workflows:
13+
- Release Sourcebot (Production)
14+
- Release setup-sourcebot
15+
types:
16+
- completed
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
concurrency:
23+
group: mirror-sourcebot-private
24+
cancel-in-progress: false
25+
26+
jobs:
27+
mirror:
28+
if: github.repository == 'sourcebot-dev/sourcebot'
29+
runs-on: ubuntu-latest
30+
environment: sourcebot-private-mirror
31+
32+
steps:
33+
- name: Check out complete repository history
34+
uses: actions/checkout@v7
35+
with:
36+
ref: main
37+
fetch-depth: 0
38+
fetch-tags: true
39+
persist-credentials: false
40+
41+
- name: Create mirror installation token
42+
id: app-token
43+
uses: actions/create-github-app-token@v3
44+
with:
45+
client-id: ${{ vars.MIRROR_APP_CLIENT_ID }}
46+
private-key: ${{ secrets.MIRROR_APP_PRIVATE_KEY }}
47+
owner: sourcebot-dev
48+
repositories: sourcebot-private
49+
permission-contents: write
50+
permission-workflows: write
51+
52+
- name: Mirror main and tags
53+
env:
54+
MIRROR_TOKEN: ${{ steps.app-token.outputs.token }}
55+
shell: bash
56+
run: |
57+
git remote add private \
58+
"https://x-access-token:${MIRROR_TOKEN}@github.com/sourcebot-dev/sourcebot-private.git"
59+
60+
git push --atomic private HEAD:refs/heads/main --tags

0 commit comments

Comments
 (0)