You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2022/11/06 16:59:38 UTC

[beam] branch master updated: Fix pr bot - exec doesn't allow command chaining

This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new bbcb790461c Fix pr bot - exec doesn't allow command chaining
bbcb790461c is described below

commit bbcb790461c47d22399c681cd42c434b206eb550
Author: Danny McCormick <da...@google.com>
AuthorDate: Sun Nov 6 11:59:32 2022 -0500

    Fix pr bot - exec doesn't allow command chaining
---
 scripts/ci/pr-bot/shared/persistentState.ts | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/ci/pr-bot/shared/persistentState.ts b/scripts/ci/pr-bot/shared/persistentState.ts
index 355ce8029c6..336fa91be66 100644
--- a/scripts/ci/pr-bot/shared/persistentState.ts
+++ b/scripts/ci/pr-bot/shared/persistentState.ts
@@ -39,7 +39,14 @@ async function commitStateToRepo() {
       `Unable to get most recent repo contents, commit may fail: ${err}`
     );
   }
-  await exec.exec("(git diff-index --quiet origin/pr-bot-state) || (git add state/* && git commit -m 'Updating config from bot' && git push origin pr-bot-state)");
+  const changes = await exec.exec("git diff-index --quiet origin/pr-bot-state");
+  if (changes == 1) {
+    await exec.exec("git add state/*");
+    await exec.exec(`git commit -m "Updating config from bot"`);
+    await exec.exec("git push origin pr-bot-state");
+  } else {
+    console.log("Skipping updating state branch since there are no changes to commit");
+  }
 }
 
 export class PersistentState {