Copilot commented on code in PR #2984:
URL: https://github.com/apache/hugegraph/pull/2984#discussion_r3052591411
##########
.github/workflows/rerun-ci.yml:
##########
@@ -0,0 +1,36 @@
+name: "Rerun CI"
+
+on:
+ workflow_run:
+ workflows:
+ - "HugeGraph-Server CI"
+ - "HugeGraph-Commons CI"
+ - "HugeGraph-PD & Store & Hstore CI"
+ - "Cluster Test CI"
+ types:
+ - completed
+
+permissions:
+ actions: write
+ contents: read
+
+jobs:
+ rerun-failed-jobs:
+ if: >-
Review Comment:
This controller will rerun failed runs for these workflows regardless of
what triggered them (e.g., `push` to `master`/`release-*` as well as
`pull_request`). If the intent is only to help flaky PR checks (as described in
the issue/PR), consider adding a guard like `github.event.workflow_run.event ==
'pull_request'` (and optionally limiting to the base repo) to avoid consuming
extra CI minutes on branch builds.
```suggestion
if: >-
github.event.workflow_run.event == 'pull_request' &&
```
##########
.github/workflows/rerun-ci.yml:
##########
@@ -0,0 +1,36 @@
+name: "Rerun CI"
+
+on:
+ workflow_run:
+ workflows:
+ - "HugeGraph-Server CI"
+ - "HugeGraph-Commons CI"
+ - "HugeGraph-PD & Store & Hstore CI"
+ - "Cluster Test CI"
+ types:
+ - completed
+
+permissions:
+ actions: write
+ contents: read
+
+jobs:
+ rerun-failed-jobs:
+ if: >-
+ github.event.workflow_run.conclusion == 'failure' &&
+ fromJSON(github.event.workflow_run.run_attempt) < 2
Review Comment:
`github.event.workflow_run.run_attempt` is already a number in the
`workflow_run` payload. Wrapping it in `fromJSON(...)` will fail expression
evaluation (fromJSON expects a string) and can prevent the job from running.
Compare the value directly (or use a numeric cast via `toJSON`/`fromJSON` only
if you first convert to a string).
```suggestion
github.event.workflow_run.run_attempt < 2
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]