1- ---
21# The aim of this GitHub workflow is to update the pipfile to sync with Codeflare-SDK release.
32name : Sync with codeflare-sdk release
4- on : # yamllint disable-line rule:truthy
3+ on :
54 workflow_dispatch :
65 inputs :
6+ upstream-repository-organization :
7+ required : true
8+ description : " Provide the upstream repository organization name"
9+
710 codeflare-repository-organization :
811 required : true
912 description : " Provide the Codeflare repository organization name"
1619 BRANCH_NAME : main
1720 CODEFLARE_RELEASE_VERSION : ${{ github.event.inputs.codeflare_sdk_release_version }}
1821 UPDATER_BRANCH : odh-sync-updater-${{ github.run_id }}
22+ UPSTREAM_OWNER : ${{ github.event.inputs.upstream-repository-organization }}
1923 REPO_OWNER : ${{ github.event.inputs.codeflare-repository-organization }}
2024 REPO_NAME : notebooks
2125 GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
@@ -24,22 +28,20 @@ jobs:
2428 build :
2529 runs-on : ubuntu-latest
2630 steps :
27- - uses : actions/checkout@v3
31+ - uses : actions/checkout@v4
2832 with :
2933 ref : ${{ env.BRANCH_NAME }}
3034
31- - name : Clone repository
32- id : Clone
35+ - name : Clone repository and Sync
3336 run : |
34- git clone https://github.com/$REPO_OWNER/$REPO_NAME.git $REPO_NAME
37+ git clone https://x-access-token:${GITHUB_TOKEN}@ github.com/$REPO_OWNER/$REPO_NAME.git $REPO_NAME
3538 cd $REPO_NAME
36-
37- - name : Set up Git
38- run : |
39+ git remote add upstream https://github.com/$UPSTREAM_OWNER/$REPO_NAME.git
3940 git config --global user.email "[email protected] " 4041 git config --global user.name "codeflare-machine-account"
42+ git remote -v
43+ git pull upstream main && git push origin main
4144
42- # Setup Python environment
4345 - name : Setup Python environment
4446 uses : actions/setup-python@v4
4547 with :
@@ -82,12 +84,12 @@ jobs:
8284 total=${#directories[@]}
8385 for dir in "${directories[@]}"; do
8486 counter=$((counter+1))
85- echo -e "\n --Processing directory ( $counter) '$dir' of total $total"
87+ echo " --Processing directory $counter '$dir' of total $total"
8688 cd "$dir" && pipenv install codeflare-sdk~="${CODEFLARE_RELEASE_VERSION}" && pipenv --rm && cd -
8789 echo "$((total-counter)) directories remaining.."
8890 done
8991
90- - name : Push changes to forked repository
92+ - name : Push changes
9193 run : |
9294 cd $REPO_NAME
9395 git add . && git status && git checkout -b ${{ env.UPDATER_BRANCH }} && \
@@ -97,14 +99,12 @@ jobs:
9799
98100 - name : Create Pull Request
99101 run : |
100- gh pr create --repo $REPO_OWNER /$REPO_NAME \
102+ gh pr create --repo $UPSTREAM_OWNER /$REPO_NAME \
101103 --title "$pr_title" \
102104 --body "$pr_body" \
103- --label "$pr_label" \
104105 --head $REPO_OWNER:$UPDATER_BRANCH \
105106 --base $BRANCH_NAME
106107 env :
107- pr_label : " automated pr"
108108 pr_title : " [Digest Updater Action] Update notebook's pipfile to sync with Codeflare-SDK release"
109109 pr_body : |
110110 :rocket: This is an automated Pull Request.
0 commit comments