Skip to content

Create a PR with updated @loadmill/agent #17935

Create a PR with updated @loadmill/agent

Create a PR with updated @loadmill/agent #17935

name: Create a PR with updated @loadmill/agent
on:
schedule:
# Run this action every hour on the hour (00:00, 01:00, 02:00, etc.)
- cron: '0 * * * *'
jobs:
check-package-updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Check If Installed @loadmill/agent Version Is Outdated
run: yarn outdated @loadmill/agent
id: outdated_agent_package
continue-on-error: true
- name: Fail Fast On Agent Is Up To Date
if: steps.outdated_agent_package.outcome == 'success'
run: fail-fast
id: fail_on_up_to_date
- name: Get Latest @loadmill/agent Version
run: echo "agent_latest_version=$(yarn info @loadmill/agent --json | python3 -c "import sys, json; print(json.load(sys.stdin)['data']['version'])")" >> $GITHUB_OUTPUT
id: get_latest_agent_version
- name: Show Latest @loadmill/agent Version
run: echo ${{ steps.get_latest_agent_version.outputs.agent_latest_version }}
- name: Check If PR's branch Already Exists
run: git ls-remote --exit-code origin agent-version-${{ steps.get_latest_agent_version.outputs.agent_latest_version }}
id: already_exists
continue-on-error: true
- name: Fail Fast When PR Already Exists
if: steps.already_exists.outcome == 'success'
run: fail-fast
id: fail_on_pr_aready_exists
- name: Install New @loadmill/agent Version
run: yarn add @loadmill/agent
- name: Increment This Repo's Patch Version
run: yarn version --patch --no-git-tag-version
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: πŸ‘†πŸ•΅οΈ Upgrade to agent version ${{ steps.get_latest_agent_version.outputs.agent_latest_version }}
title: πŸ‘†πŸ•΅οΈ Upgrade to agent version ${{ steps.get_latest_agent_version.outputs.agent_latest_version }}
body: This PR is autogenerated when a new @loadmill/agent version has been released.
branch: agent-version-${{ steps.get_latest_agent_version.outputs.agent_latest_version }}
reviewers: yigaldviri, Gilad-Gur-Andelman