Skip to content

Commit abb133e

Browse files
Dynamic notebooks sync workflow
1 parent 73b8cb7 commit abb133e

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/odh-notebooks-sync.yml

+13-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ on:
77
required: true
88
description: "Owner of target upstream notebooks repository used to open a PR against"
99
default: "opendatahub-io"
10-
10+
notebooks-target-branch:
11+
required: true
12+
description: "Target branch of upstream repository"
13+
default: "main"
14+
python-version:
15+
required: true
16+
description: "Provide the python version to be used for the notebooks"
17+
default: "3.11"
1118
codeflare-repository-organization:
1219
required: true
1320
description: "Owner of origin notebooks repository used to open a PR"
@@ -18,7 +25,8 @@ on:
1825
description: "Provide version of the Codeflare-SDK release"
1926

2027
env:
21-
BRANCH_NAME: main
28+
BRANCH_NAME: ${{ github.event.inputs.notebooks-target-branch }}
29+
PYTHON_VERSION: ${{ github.event.inputs.python-version }}
2230
CODEFLARE_RELEASE_VERSION: ${{ github.event.inputs.codeflare_sdk_release_version }}
2331
UPDATER_BRANCH: odh-sync-updater-${{ github.run_id }}
2432
UPSTREAM_OWNER: ${{ github.event.inputs.upstream-repository-organization }}
@@ -39,14 +47,12 @@ jobs:
3947
git config --global user.email "[email protected]"
4048
git config --global user.name "codeflare-machine-account"
4149
git remote -v
42-
git pull upstream main && git push origin main
50+
git pull upstream $BRANCH_NAME && git push origin $BRANCH_NAME
4351
4452
- name: Setup Python environment
4553
uses: actions/setup-python@v4
4654
with:
47-
python-version: |
48-
3.9
49-
3.11
55+
python-version: ${{ env.PYTHON_VERSION }}
5056
cache: 'pipenv'
5157

5258
- name: Install pipenv and pip-versions
@@ -55,7 +61,7 @@ jobs:
5561
- name: Update Pipfiles in accordance with Codeflare-SDK latest release
5662
run: |
5763
package_name=codeflare-sdk
58-
available_python_versions=("3.9" "3.11") # add space separated python versions according to 'python-versions' specified in 'Setup Python Environment' step
64+
available_python_versions=("$PYTHON_VERSION") # add space separated python versions according to 'python-versions' specified in 'Setup Python Environment' step
5965
install_package_using_pipenv(){
6066
# args allow custom names for Pipfile and Pipfile.lock
6167
if [ $# -eq 2 ]; then

0 commit comments

Comments
 (0)