Skip to content

Commit 5f26d3f

Browse files
committed
DO NOT MERGE: Job verification
1 parent 75824e8 commit 5f26d3f

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Mirror Repository
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
# Concurrency control to prevent parallel runs
9+
concurrency:
10+
group: premerge-mirror-verification-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
mirror-repository:
18+
runs-on: self-hosted
19+
container:
20+
image: docker:dind
21+
timeout-minutes: 30
22+
# Only run on specific repository and specific PRs
23+
if: github.repository == 'isaac-sim/IsaacLab' && github.event.pull_request.base.ref == 'main'
24+
environment:
25+
name: mirror-production
26+
url: https://github.com/${{ vars.TARGET_REPO }}
27+
28+
steps:
29+
- name: Install Git LFS
30+
run: |
31+
apk update
32+
apk add --no-cache git-lfs
33+
git lfs install
34+
35+
- name: Checkout Code
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
lfs: true
40+
41+
- name: Configure Git
42+
run: |
43+
git config --global user.name "Isaac LAB CI Bot"
44+
git config --global user.email "isaac-lab-ci-bot@nvidia.com"
45+
46+
- name: Check Environment
47+
run: |
48+
echo "🔍 Environment Check:"
49+
echo "TARGET_REPO: ${{ vars.TARGET_REPO }}"
50+
echo "GH_TOKEN available: ${{ secrets.GH_TOKEN != '' && 'Yes' || 'No' }}"
51+
echo "Repository: ${{ github.repository }}"
52+
echo "Runner OS: $(uname -a)"
53+
echo "Git version: $(git --version)"
54+
55+
- name: Mirror to Target Repository
56+
run: |
57+
git config --global --add safe.directory ${{ github.workspace }}
58+
git config --global --add safe.directory .
59+
60+
# Set the target repository as origin (like CodeBuild does)
61+
git remote set-url origin https://github.com/${{ vars.TARGET_REPO }}.git
62+
63+
# Create PR branch name for verification
64+
PR_BRANCH_NAME="pr-${{ github.event.number }}-${{ github.head_ref }}"
65+
66+
# Create a temporary branch with the PR changes
67+
git checkout -b $PR_BRANCH_NAME
68+
69+
# Push the temporary branch to the target repository for verification
70+
git push --force https://${{ secrets.GH_TOKEN }}@github.com/${{ vars.TARGET_REPO }}.git $PR_BRANCH_NAME
71+
72+
echo "✅ Successfully pushed PR verification branch to ${{ vars.TARGET_REPO }}:$PR_BRANCH_NAME"
73+
echo "PR Number: ${{ github.event.number }}"
74+
echo "PR Head Branch: ${{ github.head_ref }}"

0 commit comments

Comments
 (0)