Skip to content

Commit 83bdcad

Browse files
committed
Restart the workflow if PR has been updated
Signed-off-by: Simon Davies <[email protected]>
1 parent da37ab7 commit 83bdcad

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/ValidatePullRequest.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
with:
5252
ref: ${{ github.head_ref }}
5353
- name: Update Cargo.lock for dependabot changes
54+
id: update-cargo-lock
5455
if: ${{ github.actor == 'dependabot[bot]' && steps.changes.outputs.common_deps_count > 0 }}
5556
run: |
5657
cargo update --manifest-path src/tests/rust_guests/simpleguest/Cargo.toml
@@ -62,7 +63,17 @@ jobs:
6263
git add src/tests/rust_guests/callbackguest/Cargo.lock
6364
git commit -m "Update Cargo.lock files for dependabot changes"
6465
git push
66+
// Set an output to indicate that the PR branch has been updated
67+
echo "pr_updated=1" >> "$GITHUB_OUTPUT"
6568
fi
69+
- name: Restart workflow if changes have been made
70+
if: steps.update-cargo-lock.outputs.pr_updated == '1'
71+
uses: actions/github-script@v7
72+
with:
73+
github-token: ${{ secrets.GITHUB_TOKEN }}
74+
script: |
75+
github.actions.log('Restarting workflow due to changes in the PR branch');
76+
github.actions.restart()
6677
6778
rust:
6879
needs:

0 commit comments

Comments
 (0)