1515 - staging
1616 types : [opened, synchronize, reopened, labeled, unlabeled]
1717
18+ workflow_dispatch :
19+ inputs :
20+ bittensor_branch :
21+ description : " Optional: Bittensor branch to use instead of staging"
22+ required : false
23+ default : " staging"
24+
1825env :
1926 CARGO_TERM_COLOR : always
2027 VERBOSE : ${{ github.event.inputs.verbose }}
28+ BITTENSOR_BRANCH : ${{ github.event.inputs.bittensor_branch || 'staging' }}
2129
2230jobs :
2331 apply-label-to-new-pr :
7987 working-directory : ${{ github.workspace }}
8088 run : git clone https://github.com/opentensor/bittensor.git
8189
82- - name : Checkout
90+ - name : Verify and checkout Bittensor branch
8391 working-directory : ${{ github.workspace }}/bittensor
84- run : git checkout staging
92+ run : |
93+ if ! git fetch origin $BITTENSOR_BRANCH; then
94+ echo "❌ Error: Branch '$BITTENSOR_BRANCH' does not exist in opentensor/bittensor."
95+ exit 1
96+ fi
97+ git checkout FETCH_HEAD
98+ echo "✅ Using Bittensor branch: $BITTENSOR_BRANCH"
8599
86100 - name : Install dependencies
87101 run : sudo apt-get install -y jq
@@ -90,11 +104,14 @@ jobs:
90104 id : get-tests
91105 run : |
92106 test_files=$(find ${{ github.workspace }}/bittensor/tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
93- echo "::set-output name= test-files:: $test_files"
107+ echo "test-files= $test_files" >> $GITHUB_OUTPUT
94108 shell : bash
95109
96110 pull-docker-image :
97- needs : check-labels
111+ needs :
112+ - check-labels
113+ - find-e2e-tests
114+
98115 runs-on : ubuntu-latest
99116 if : always() && needs.check-labels.outputs.run-sdk-tests == 'true'
100117 steps :
@@ -163,8 +180,12 @@ jobs:
163180 working-directory : ${{ github.workspace }}/bittensor
164181 run : |
165182 source ${{ github.workspace }}/venv/bin/activate
166- git checkout staging
167- git fetch origin staging
183+ if ! git fetch origin $BITTENSOR_BRANCH; then
184+ echo "❌ Error: Branch '$BITTENSOR_BRANCH' does not exist in opentensor/bittensor."
185+ exit 1
186+ fi
187+ git checkout FETCH_HEAD
188+ echo "✅ Using Bittensor branch: $BITTENSOR_BRANCH"
168189 python3 -m pip install --upgrade pip
169190 python3 -m pip install '.[dev]'
170191
@@ -225,8 +246,12 @@ jobs:
225246 working-directory : ${{ github.workspace }}/bittensor
226247 run : |
227248 source ${{ github.workspace }}/venv/bin/activate
228- git checkout staging
229- git fetch origin staging
249+ if ! git fetch origin $BITTENSOR_BRANCH; then
250+ echo "❌ Error: Branch '$BITTENSOR_BRANCH' does not exist in opentensor/bittensor."
251+ exit 1
252+ fi
253+ git checkout FETCH_HEAD
254+ echo "✅ Using Bittensor branch: $BITTENSOR_BRANCH"
230255 python3 -m pip install --upgrade pip
231256 python3 -m pip install '.[dev]'
232257
0 commit comments