From f74ae9b56b88b10e740939ccada77958f2387989 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 14:58:50 +0000 Subject: [PATCH 01/13] fix typo --- .github/workflows/update-weaviate-server.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index 01f02b6..120f61b 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -18,7 +18,7 @@ jobs: sudo apt-get install -y jq - name: Update Weaviate Version - run: make update-weaviate-version + run: make update-weaviate-image - name: Commit and push if changed run: | From 5bbcf42c6e3cefdc6d714766b8c50bb5384e5c12 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 14:59:07 +0000 Subject: [PATCH 02/13] better docs --- .github/workflows/update-weaviate-server.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index 120f61b..91ab989 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -1,4 +1,4 @@ -name: Update Weaviate Version +name: Update Weaviate Server Image on: workflow_dispatch: @@ -17,7 +17,7 @@ jobs: sudo apt-get update sudo apt-get install -y jq - - name: Update Weaviate Version + - name: Update Image run: make update-weaviate-image - name: Commit and push if changed From 68704036f941912fd4708e7344008ab5f01de8d0 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 15:01:06 +0000 Subject: [PATCH 03/13] test the workflow in the current branch --- .github/workflows/update-weaviate-server.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index 91ab989..36afd66 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -1,6 +1,12 @@ name: Update Weaviate Server Image -on: +on: + push: + branches: + - weaviate-server + pull_request: + branches: + - weaviate-server workflow_dispatch: schedule: - cron: '0 0 * * 1' # Every Monday at 00:00 UTC From 16b361dc8d2492d713416be4184f472db099083e Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 15:02:13 +0000 Subject: [PATCH 04/13] Update Weaviate version in tests/docker-compose.yml --- tests/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index a4bddf2..759cf0f 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -9,7 +9,7 @@ services: - '8080' - --scheme - http - image: semitechnologies/weaviate:1.23.3 + image: semitechnologies/weaviate:1.23.5 ports: - "8080" - "50051" From 3704377f9748695667adaa0999c57ee136beba96 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 15:04:28 +0000 Subject: [PATCH 05/13] fix case --- .github/workflows/update-weaviate-server.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index 36afd66..10725b0 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -1,4 +1,4 @@ -name: Update Weaviate Server Image +name: Update weaviate server image on: push: From 332c6dde5dea1ad109ab84948678a42305b5459a Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 15:08:21 +0000 Subject: [PATCH 06/13] fix typo --- .github/workflows/update-weaviate-server.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index 10725b0..84afdda 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -36,7 +36,7 @@ jobs: - name: Create Pull Request uses: actions/github-script@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} script: | const title = "Update Weaviate Version"; const body = "This PR updates the Weaviate version in tests/docker-compose.yml"; From 411343f27e12e593082c94668569b605cf618432 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 15:17:37 +0000 Subject: [PATCH 07/13] update script to latest version --- .github/workflows/update-weaviate-server.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index 84afdda..4db1589 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -34,7 +34,7 @@ jobs: git diff-index --quiet HEAD || (git commit -m "Update Weaviate version in tests/docker-compose.yml" && git push) - name: Create Pull Request - uses: actions/github-script@v3 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | From 1d10b9f25c218cca523952dd08812d9c9a5ce335 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 15:24:35 +0000 Subject: [PATCH 08/13] update script --- .github/workflows/update-weaviate-server.yml | 25 +++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index 4db1589..f486e9c 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -38,9 +38,22 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const title = "Update Weaviate Version"; - const body = "This PR updates the Weaviate version in tests/docker-compose.yml"; - const branch = "main"; # Change to your target branch - const head = process.env.GITHUB_REF.split('/').pop(); - const base = branch; - github.pulls.create({owner, repo, title, body, head, base}); + const { repo, owner } = context.repo; + const result = await github.rest.pulls.create({ + title: 'Update Weaviate Server Image', + owner, + repo, + head: '${{ github.ref_name }}', + base: 'main', + body: [ + 'This PR updates the Weaviate version in tests/docker-compose.yml', + 'This PR is auto-generated by', + '[actions/github-script](https://github.com/actions/github-script).' + ].join('\n') + }); + github.rest.issues.addLabels({ + owner, + repo, + issue_number: result.data.number, + labels: ['quality-improvement', 'automated pr'] + }); \ No newline at end of file From 399377f4cd69754ca22fb76fbdf11365e4f184ac Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 19:02:39 +0000 Subject: [PATCH 09/13] Update Weaviate version in tests/docker-compose.yml --- tests/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 759cf0f..1ae2795 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -9,7 +9,7 @@ services: - '8080' - --scheme - http - image: semitechnologies/weaviate:1.23.5 + image: semitechnologies/weaviate:1.23.6 ports: - "8080" - "50051" From 91841cdb1c4cc1d637abd44ef0523e42d1bc3519 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 19:09:50 +0000 Subject: [PATCH 10/13] commit to a different branch --- .github/workflows/update-weaviate-server.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index f486e9c..9b1be6f 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -31,7 +31,7 @@ jobs: git config --global user.name '${{ github.actor }}' git config --global user.email '${{ github.actor }}@users.noreply.github.com' git add tests/docker-compose.yml - git diff-index --quiet HEAD || (git commit -m "Update Weaviate version in tests/docker-compose.yml" && git push) + git diff-index --quiet HEAD || (git checkout -b update-weaviate-image && git commit -m "Update Weaviate version in tests/docker-compose.yml" && git push) - name: Create Pull Request uses: actions/github-script@v7 From cecf4c704edc9c33f42bcc055e33281943eef2be Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 19:16:38 +0000 Subject: [PATCH 11/13] PR should merge from update-weaviate-image branch --- .github/workflows/update-weaviate-server.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index 348e639..048e1c4 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -43,7 +43,7 @@ jobs: title: 'Update Weaviate Server Image', owner, repo, - head: '${{ github.ref_name }}', + head: 'update-weaviate-image', base: 'main', body: [ 'This PR updates the Weaviate version in tests/docker-compose.yml', From 345a45e72db63f7ac5113f559f061633883957d0 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 19:28:29 +0000 Subject: [PATCH 12/13] refactor source branch name for PR --- .github/workflows/update-weaviate-server.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-weaviate-server.yml b/.github/workflows/update-weaviate-server.yml index 048e1c4..2d38cae 100644 --- a/.github/workflows/update-weaviate-server.yml +++ b/.github/workflows/update-weaviate-server.yml @@ -10,6 +10,8 @@ on: workflow_dispatch: schedule: - cron: '0 0 * * 1' # Every Monday at 00:00 UTC +env: + SOURCE_BRANCH_NAME: update-weaviate-image jobs: update-version: @@ -31,7 +33,7 @@ jobs: git config --global user.name '${{ github.actor }}' git config --global user.email '${{ github.actor }}@users.noreply.github.com' git add tests/docker-compose.yml - git diff-index --quiet HEAD || (git checkout -b update-weaviate-image && git commit -m "Update Weaviate version in tests/docker-compose.yml" && git push --set-upstream origin update-weaviate-image) + git diff-index --quiet HEAD || (git checkout -b ${{ env.SOURCE_BRANCH_NAME }} && git commit -m "Update Weaviate version in tests/docker-compose.yml" && git push --set-upstream origin ${{ env.SOURCE_BRANCH_NAME }}) - name: Create Pull Request uses: actions/github-script@v7 @@ -43,7 +45,7 @@ jobs: title: 'Update Weaviate Server Image', owner, repo, - head: 'update-weaviate-image', + head: '${{ env.SOURCE_BRANCH_NAME }}', base: 'main', body: [ 'This PR updates the Weaviate version in tests/docker-compose.yml', From cbd276c5e1adb76751bcb29fac8d9a5fd2615b60 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Fri, 26 Jan 2024 19:29:43 +0000 Subject: [PATCH 13/13] Update Weaviate version in tests/docker-compose.yml --- tests/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 759cf0f..1ae2795 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -9,7 +9,7 @@ services: - '8080' - --scheme - http - image: semitechnologies/weaviate:1.23.5 + image: semitechnologies/weaviate:1.23.6 ports: - "8080" - "50051"