Skip to content

Create PR to update elife api dependencies to latest #22

Create PR to update elife api dependencies to latest

Create PR to update elife api dependencies to latest #22

name: Create PR to update elife api dependencies to latest
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * 1'
jobs:
update-api-dummy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: old-versions
run: |
echo api-sdk-version=$(jq -r '.packages[]|select(.name == "elife/api-sdk").source.reference' < composer.lock) >> $GITHUB_OUTPUT
echo api-version=$(jq -r '.packages[]|select(.name == "elife/api").version' < composer.lock) >> $GITHUB_OUTPUT
- name: Check for api-sdk updates
run: |
docker compose run --no-deps setup composer install
docker compose run --no-deps setup composer update 'elife/api' 'elife/api-sdk' --no-suggest --no-interaction
- id: new-versions
run: |
echo api-sdk-version=$(jq -r '.packages[]|select(.name == "elife/api-sdk").source.reference' < composer.lock) >> $GITHUB_OUTPUT
echo api-version=$(jq -r '.packages[]|select(.name == "elife/api").version' < composer.lock) >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
add-paths: composer.lock
commit-message: |
Update elife API packages:
- `elife/api` from `${{ steps.old-versions.outputs.api-version }}` to `${{ steps.new-versions.outputs.api-version }}`
- `elife/api-sdk` from `${{ steps.old-versions.outputs.api-sdk-version }}` to `${{ steps.new-versions.outputs.api-sdk-version }}`
branch: update-api-sdk
title: Update elife API packages(`elife/api`:`${{ steps.new-versions.outputs.api-version }}` - `elife/api-sdk`:`${{ steps.new-versions.outputs.api-sdk-version }}`)
body: |
Update elife API packages:
- `elife/api` from `${{ steps.old-versions.outputs.api-old-version }}` to `${{ steps.new-versions.outputs.api-version }}`
- `elife/api-sdk` from `${{ steps.old-versions.outputs.api-sdk-old-version }}` to `${{ steps.new-versions.outputs.api-sdk-version }}`