Skip to content

Commit

Permalink
update packages PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mayur-sose committed Jan 15, 2025
1 parent fa6d524 commit af7a9ec
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/update-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,43 @@ jobs:
php-version: '8.1'
tools: composer

# Step 3: Add/Update Dependencies
# 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: Run Update Script
# Step 5: Reset Composer Changes
- name: Reset Composer Changes
run: |
git checkout -- composer.json composer.lock
# Step 6: Run Update Script
- name: Run Update Script
run: php .github/update_packages.php

# Step 6: Reset or Recreate Branch
- name: Reset or Recreate Branch
# Step 7: Create Unique Branch and Commit Changes
- name: Create Unique Branch
run: |
TIMESTAMP=$(date +'%Y%m%d%H%M%S')
BRANCH_NAME="update-packages-${TIMESTAMP}"
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git branch -D update-packages || true
git checkout -b update-packages
git checkout -b "$BRANCH_NAME"
git add config/packages.yml
git commit -m "Update dependencies in packages.yml"
git push origin update-packages --force
git diff --staged --quiet && echo "No changes to commit" || git commit -m "Update dependencies in packages.yml"
git push origin "$BRANCH_NAME"
# Step 7: Create or Update Pull Request
# Step 8: Create Pull Request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-packages
branch: ${{ steps.create-unique-branch.outputs.branch_name }}
base: develop
title: Update packages.yml with latest versions
title: Update packages.yml with latest versions (Run ${{ steps.create-unique-branch.outputs.branch_name }})
body: |
This pull request updates the `packages.yml` file with the latest stable versions of dependencies.
If no changes are detected, this is a placeholder PR for consistency.
labels: dependencies
delete-branch: true

0 comments on commit af7a9ec

Please sign in to comment.