Skip to content

Commit

Permalink
Cargo update cow only
Browse files Browse the repository at this point in the history
  • Loading branch information
squadgazzz committed Jun 19, 2024
1 parent cfb58ff commit 9f037b7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/update-cow-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,22 @@ jobs:
run: |
sed -i '/git = "https:\/\/github.com\/cowprotocol\/services.git"/s/tag = "v[0-9]*\.[0-9]*\.[0-9]*"/tag = "${{ env.TAG }}"/g' ./Cargo.toml
- name: Update Cargo.lock
run: cargo update
- name: Identify and update specific CoW dependencies in Cargo.lock
run: |
PACKAGES=$(grep -oP 'package = "\K[^"]*' <(grep -B1 'git = "https:\/\/github.com\/cowprotocol\/services.git"' Cargo.toml))
echo "Identified packages: $PACKAGES"
for package in $PACKAGES; do
echo "Updating package: $package"
cargo update -p $package
done
- name: Check for changes
id: check_changes
run: |
git diff --exit-code || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
- name: Commit changes
if: env.CHANGES_DETECTED == 'true'
run: |
git config --global user.name 'Your Name'
git config --global user.email 'your-email@example.com'
Expand All @@ -45,13 +57,14 @@ jobs:
git push --set-upstream origin update-cow-dependencies/${{ env.TAG }}
- name: Extract commit message
id: commit
if: env.CHANGES_DETECTED == 'true'
run: |
echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "pr_body=Updated CoW dependencies to ${{ env.TAG }}" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: env.CHANGES_DETECTED == 'true'
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ steps.commit.outputs.branch }}
Expand Down

0 comments on commit 9f037b7

Please sign in to comment.