-
Notifications
You must be signed in to change notification settings - Fork 1.1k
60 lines (53 loc) · 2.07 KB
/
bump_synthetics_worker_version.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
on:
schedule:
# At 08:00 on every day-of-week from Monday through Friday.
- cron: '0 8 * * 1-5'
workflow_dispatch: # allows manual trigger
jobs:
synthetics-worker-version:
permissions:
contents: write # for git push
pull-requests: write # to create pull request
runs-on: ubuntu-latest
name: Find latest synthetics-worker version
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/[email protected]
with:
python-version: '3.11'
- run: pip install requests semver defusedxml
- name: Find latest synthetic-worker version
id: write-synthetics-worker-version
run: |
python local/bin/py/version_getter.py
- name: echo new version
run: echo ${{ steps.write-synthetics-worker-version.outputs.new_version }}
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Write version
if: steps.write-synthetics-worker-version.outputs.new_version == 'true'
run: |-
git config user.name documentation-ci
git config user.email [email protected]
git add ./data/synthetics_worker_versions.json
git commit -m "(Automated) Bump synthetics-worker version"
git push -f origin HEAD:refs/heads/synthetics-worker/versions
- uses: actions/github-script@v7
name: Propose change with latest versions
if: steps.write-synthetics-worker-version.outputs.new_version == 'true'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "(Automated) Bump synthetics-worker version",
body: "### Merge instructions\n- [x] Please merge after reviewing",
head: "synthetics-worker/versions",
base: "master",
maintainer_can_modify: true
})