Skip to content

.github/workflows/bump_synthetics_worker_version.yml #70

.github/workflows/bump_synthetics_worker_version.yml

.github/workflows/bump_synthetics_worker_version.yml #70

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
})