Skip to content

Commit 663a4ba

Browse files
committed
Add a check for dependabot PR updating guest or common lib dependencies
Signed-off-by: Simon Davies <[email protected]>
1 parent 596d116 commit 663a4ba

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/ValidatePullRequest.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ jobs:
4040
let all_file_count = ${{steps.changes.outputs.all_count}};
4141
return all_file_count === docs_file_count;
4242
result-encoding: string
43+
# Check to see if this a dependabot PR and if it updates either the common or guest Cargo.toml files
44+
# if it does we need to try and generate a new Cargo.lock file as the PR validation checks that these are up to date
45+
- name: Update Cargo.lock for dependabot changes
46+
if: ${{ github.actor == 'dependabot[bot]' && (github.event.pull_request.changed_files.* == 'src/hyperlight_common/Cargo.toml' || github.event.pull_request.changed_files.* == 'src/hyperlight_guest/Cargo.toml') }}
47+
run: |
48+
cargo update --manifest-path src/tests/rust_guests/simpleguest/Cargo.toml
49+
cargo update --manifest-path src/tests/rust_guests/callbackguest/Cargo.toml
50+
if [ -n "$(git status --porcelain src/tests/rust_guests/simpleguest/Cargo.lock src/tests/rust_guests/callbackguest/Cargo.lock)" ]; then
51+
git config --global user.name "github-actions[bot]"
52+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
53+
git add src/tests/rust_guests/simpleguest/Cargo.lock
54+
git add src/tests/rust_guests/callbackguest/Cargo.lock
55+
git commit -m "Update Cargo.lock files for dependabot changes"
56+
git push
57+
fi
4358
4459
rust:
4560
needs:

0 commit comments

Comments
 (0)