1
- ---
2
1
# The aim of this GitHub workflow is to update the pipfile to sync with Codeflare-SDK release.
3
2
name : Sync with codeflare-sdk release
4
- on : # yamllint disable-line rule:truthy
3
+ on :
5
4
workflow_dispatch :
6
5
inputs :
6
+ upstream-repository-organization :
7
+ required : true
8
+ description : " Provide the upstream repository organization name"
9
+
7
10
codeflare-repository-organization :
8
11
required : true
9
12
description : " Provide the Codeflare repository organization name"
16
19
BRANCH_NAME : main
17
20
CODEFLARE_RELEASE_VERSION : ${{ github.event.inputs.codeflare_sdk_release_version }}
18
21
UPDATER_BRANCH : odh-sync-updater-${{ github.run_id }}
22
+ UPSTREAM_OWNER : ${{ github.event.inputs.upstream-repository-organization }}
19
23
REPO_OWNER : ${{ github.event.inputs.codeflare-repository-organization }}
20
24
REPO_NAME : notebooks
21
25
GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
@@ -24,22 +28,20 @@ jobs:
24
28
build :
25
29
runs-on : ubuntu-latest
26
30
steps :
27
- - uses : actions/checkout@v3
31
+ - uses : actions/checkout@v4
28
32
with :
29
33
ref : ${{ env.BRANCH_NAME }}
30
34
31
- - name : Clone repository
32
- id : Clone
35
+ - name : Clone repository and Sync
33
36
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
35
38
cd $REPO_NAME
36
-
37
- - name : Set up Git
38
- run : |
39
+ git remote add upstream https://github.com/$UPSTREAM_OWNER/$REPO_NAME.git
39
40
git config --global user.email "[email protected] "
40
41
git config --global user.name "codeflare-machine-account"
42
+ git remote -v
43
+ git pull upstream main && git push origin main
41
44
42
- # Setup Python environment
43
45
- name : Setup Python environment
44
46
uses : actions/setup-python@v4
45
47
with :
@@ -82,12 +84,12 @@ jobs:
82
84
total=${#directories[@]}
83
85
for dir in "${directories[@]}"; do
84
86
counter=$((counter+1))
85
- echo -e "\n --Processing directory ( $counter) '$dir' of total $total"
87
+ echo " --Processing directory $counter '$dir' of total $total"
86
88
cd "$dir" && pipenv install codeflare-sdk~="${CODEFLARE_RELEASE_VERSION}" && pipenv --rm && cd -
87
89
echo "$((total-counter)) directories remaining.."
88
90
done
89
91
90
- - name : Push changes to forked repository
92
+ - name : Push changes
91
93
run : |
92
94
cd $REPO_NAME
93
95
git add . && git status && git checkout -b ${{ env.UPDATER_BRANCH }} && \
@@ -97,14 +99,12 @@ jobs:
97
99
98
100
- name : Create Pull Request
99
101
run : |
100
- gh pr create --repo $REPO_OWNER /$REPO_NAME \
102
+ gh pr create --repo $UPSTREAM_OWNER /$REPO_NAME \
101
103
--title "$pr_title" \
102
104
--body "$pr_body" \
103
- --label "$pr_label" \
104
105
--head $REPO_OWNER:$UPDATER_BRANCH \
105
106
--base $BRANCH_NAME
106
107
env :
107
- pr_label : " automated pr"
108
108
pr_title : " [Digest Updater Action] Update notebook's pipfile to sync with Codeflare-SDK release"
109
109
pr_body : |
110
110
:rocket: This is an automated Pull Request.
0 commit comments