-
Notifications
You must be signed in to change notification settings - Fork 17
67 lines (60 loc) · 2.11 KB
/
update-weaviate-server.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Update weaviate server image
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1' # Every Monday at 00:00 UTC
env:
SOURCE_BRANCH_NAME: update-weaviate-image
permissions:
contents: write
pull-requests: write
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up required tools
run: |
sudo apt-get update
sudo apt-get install -y jq
- name: Update Image
run: make update-weaviate-image
working-directory: libs/weaviate
- name: Commit and push if changed
run: |
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 && echo "CHANGED=false" >> $GITHUB_ENV || (
echo "CHANGED=true" >> $GITHUB_ENV
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 }}
)
working-directory: libs/weaviate
- name: Create Pull Request
if: ${{ env.CHANGED == 'true' }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'Update Weaviate Server Image',
owner,
repo,
head: '${{ env.SOURCE_BRANCH_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']
});