Skip to content

Revert changes to config/packages.yml. #119

Revert changes to config/packages.yml.

Revert changes to config/packages.yml. #119

name: Update Packages and Create Pull Request
on:
schedule:
- cron: '0 0 * * 1' # Weekly on Mondays
push:
branches:
- wip
paths-ignore:
- .idea/**
- docs/**
permissions:
contents: write
pull-requests: write
jobs:
update-packages:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout Code
- name: Checkout Code
uses: actions/checkout@v3
# Step 2: Set Up PHP
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer
# Step 3: Add Guzzle Dependency
- name: Add Guzzle Dependency
run: composer require guzzlehttp/guzzle:^7.4
# Step 4: Install Dependencies
- name: Install Dependencies
run: composer install
# Step 5: Reset Composer Changes
- name: Reset Composer Changes
run: git checkout -- composer.json composer.lock
# Step 6: Run Update Script and Commit Changes
- name: Run Update Script
run: |
TIMESTAMP=$(date +'%Y%m%d%H%M%S')
BRANCH_NAME="update-packages-${TIMESTAMP}"
echo "branch_name=${BRANCH_NAME}" >> $GITHUB_ENV
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git fetch > /dev/null
git checkout -b "$BRANCH_NAME" origin/develop
git cherry-pick HEAD@{1}
php .github/update_packages.php
git status
git add config/packages.yml
git commit -m "Update dependencies in packages.yml"
git show-branch
git push origin "$BRANCH_NAME"
# Step 7: Create Pull Request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.branch_name }}
base: develop
title: "Update packages.yml with latest versions"
body: |
This pull request updates the `packages.yml` file with the latest stable versions of dependencies.
labels: dependencies