[GH-ISSUE #2660] Is There a Summary of Job Results #1204

Closed
opened 2026-03-01 21:49:40 +03:00 by kerem · 7 comments
Owner

Originally created by @Betty1202 on GitHub (Feb 11, 2025).
Original GitHub issue: https://github.com/nektos/act/issues/2660

Act version

v0.2.74

Feature description

Hello,

I am currently using Act to execute GitHub Actions workflows locally and was wondering if there is a feature that provides a summary of the execution results for each job. Specifically, I'm looking for a way to output the results (e.g., success or failure) of all jobs into a JSON or TXT file.

Having a summary in a structured format would be very helpful for analyzing the workflow outcomes programmatically. Is there an existing feature or a recommended approach to achieve this in Act?

Thank you for your assistance!

Originally created by @Betty1202 on GitHub (Feb 11, 2025). Original GitHub issue: https://github.com/nektos/act/issues/2660 ### Act version v0.2.74 ### Feature description Hello, I am currently using Act to execute GitHub Actions workflows locally and was wondering if there is a feature that provides a summary of the execution results for each job. Specifically, I'm looking for a way to output the results (e.g., success or failure) of all jobs into a JSON or TXT file. Having a summary in a structured format would be very helpful for analyzing the workflow outcomes programmatically. Is there an existing feature or a recommended approach to achieve this in Act? Thank you for your assistance!
kerem 2026-03-01 21:49:40 +03:00
Author
Owner

@ChristopherHX commented on GitHub (Feb 11, 2025):

try option --json, then try parse jsonl (json objects line by line, you should handle non json lines as well)

Displaying logs and writing the json to file is not implemented

I'm not processing feature requests right now, due to being behind my roadmap of act

<!-- gh-comment-id:2652003109 --> @ChristopherHX commented on GitHub (Feb 11, 2025): try option `--json`, then try parse jsonl (json objects line by line, you should handle non json lines as well) Displaying logs and writing the json to file is not implemented _I'm not processing feature requests right now, due to being behind my roadmap of act_
Author
Owner

@Betty1202 commented on GitHub (Feb 12, 2025):

Got it. Thanks!

<!-- gh-comment-id:2652997633 --> @Betty1202 commented on GitHub (Feb 12, 2025): Got it. Thanks!
Author
Owner

@ptagl commented on GitHub (Mar 12, 2025):

@ChristopherHX would you consider an external contribution for this feature?

It would be useful for me as well, so I tried something like this in the runStepExecutor:

...
startTime := time.Now()
err = executor(timeoutctx)
executionTime := time.Since(startTime)

if err == nil {
    logger.WithField("stepResult", stepResult.Outcome).Infof("  \u2705  Success - %s %s [%s]", stage, stepString, executionTime)
} else {
...

It's more than enough for me as it prints something like:

...
[Build-and-Test/build-and-test]   ✅  Success - Pre Setup toolchain [12.150545ms]
...
[Build-and-Test/build-and-test]   ✅  Success - Main Git checkout [780.00104ms]
...
[Build-and-Test/build-and-test]   ✅  Success - Main rustup toolchain install stable [6.67097925s]
...
<!-- gh-comment-id:2718097077 --> @ptagl commented on GitHub (Mar 12, 2025): @ChristopherHX would you consider an external contribution for this feature? It would be useful for me as well, so I tried something like this in the `runStepExecutor`: ```go ... startTime := time.Now() err = executor(timeoutctx) executionTime := time.Since(startTime) if err == nil { logger.WithField("stepResult", stepResult.Outcome).Infof(" \u2705 Success - %s %s [%s]", stage, stepString, executionTime) } else { ... ``` It's more than enough for me as it prints something like: ``` ... [Build-and-Test/build-and-test] ✅ Success - Pre Setup toolchain [12.150545ms] ... [Build-and-Test/build-and-test] ✅ Success - Main Git checkout [780.00104ms] ... [Build-and-Test/build-and-test] ✅ Success - Main rustup toolchain install stable [6.67097925s] ... ```
Author
Owner

@ChristopherHX commented on GitHub (Mar 15, 2025):

@ptagl I would suggest to add the duration as field for this as well e.g. logger.WithField so json logs also have this precalculated value.

would you consider an external contribution for this feature?

I would consider myself as somewhat external as well, since I cannot decide on my own if your PR would be merged (here in nektos/act).

I'm perfectly fine with your logger enhancement, then my github-act-runner act log file has durations as well without needing to look at the webui of GitHub.

<!-- gh-comment-id:2726488212 --> @ChristopherHX commented on GitHub (Mar 15, 2025): @ptagl I would suggest to add the duration as field for this as well e.g. `logger.WithField` so json logs also have this precalculated value. > would you consider an external contribution for this feature? I would consider myself as somewhat external as well, since I cannot decide on my own if your PR would be merged (here in nektos/act). I'm perfectly fine with your logger enhancement, then my github-act-runner act log file has durations as well without needing to look at the webui of GitHub.
Author
Owner

@ptagl commented on GitHub (Mar 17, 2025):

@ptagl I would suggest to add the duration as field for this as well e.g. logger.WithField so json logs also have this precalculated value.

Do you mean something like this?

logger.WithFields(logrus.Fields{"executionTime": executionTime, "stepResult": stepResult.Outcome}).Infof("  \u2705  Success - %s %s [%s]", stage, stepString, executionTime)

Standard log:

[ci/job1]   ✅  Success - Main Step 1 [1.039520012s]

JSON log:

{"dryrun":false,"executionTime":1039563535,"job":"ci/job1","jobID":"job1","level":"info","matrix":{},"msg":"  ✅  Success - Main Step 1 [1.039563535s]","stage":"Main","step":"Step 1","stepID":["0"],"stepResult":"success","time":"2025-03-17T10:17:21+01:00"}

A small off-topic: I was trying to run tests with make test but I'm getting errors even on master without any changes (commit ID eb46e8aa5a23f99c76be4a53413a856d6b236145). The same happens if I try to run act --job test-linux.

make-test.log

Any idea about what could be wrong here? I already followed the documentation and launched docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64.

<!-- gh-comment-id:2728878317 --> @ptagl commented on GitHub (Mar 17, 2025): > [@ptagl](https://github.com/ptagl) I would suggest to add the duration as field for this as well e.g. `logger.WithField` so json logs also have this precalculated value. Do you mean something like this? ```go logger.WithFields(logrus.Fields{"executionTime": executionTime, "stepResult": stepResult.Outcome}).Infof(" \u2705 Success - %s %s [%s]", stage, stepString, executionTime) ``` Standard log: ```log [ci/job1] ✅ Success - Main Step 1 [1.039520012s] ``` JSON log: ```json {"dryrun":false,"executionTime":1039563535,"job":"ci/job1","jobID":"job1","level":"info","matrix":{},"msg":" ✅ Success - Main Step 1 [1.039563535s]","stage":"Main","step":"Step 1","stepID":["0"],"stepResult":"success","time":"2025-03-17T10:17:21+01:00"} ``` A small off-topic: I was trying to run tests with `make test` but I'm getting errors even on `master` without any changes (commit ID `eb46e8aa5a23f99c76be4a53413a856d6b236145`). The same happens if I try to run `act --job test-linux`. [make-test.log](https://github.com/user-attachments/files/19283765/make-test.log) Any idea about what could be wrong here? I already followed the [documentation](https://github.com/nektos/act/blob/master/CONTRIBUTING.md) and launched `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`.
Author
Owner

@ChristopherHX commented on GitHub (Mar 17, 2025):

Do you mean something like this?

logger.WithFields(logrus.Fields{"executionTime": executionTime, "stepResult": stepResult.Outcome}).Infof(" \u2705 S

yes

Any idea about what could be wrong here

I only run selected failing tests locally, yes running the whole test suite is likely to fail on your system.

There seems to be problems when rerunning certain tests, not all of them are stateless.

If you have an ubuntu 22.04/24.04 x86_64 system + tonistiigi/binfmt for arm64 tests + a empty dockerd instance you can finish them exactly once without errors. For the second time you need to cleanup dockerd again.

github.com/nektos/act/report/updated_sources/pkg/runner

you have an nested act checkout?, obviously this fails as it detects tests inside that folders that fail to compile

If you use multiple worktrees, place them outside of the src of act otherwise the ./... pattern would match them as well

<!-- gh-comment-id:2730255107 --> @ChristopherHX commented on GitHub (Mar 17, 2025): > Do you mean something like this? > > logger.WithFields(logrus.Fields{"executionTime": executionTime, "stepResult": stepResult.Outcome}).Infof(" \u2705 S yes > Any idea about what could be wrong here I only run selected failing tests locally, yes running the whole test suite is likely to fail on your system. There seems to be problems when rerunning certain tests, not all of them are stateless. If you have an ubuntu 22.04/24.04 x86_64 system + tonistiigi/binfmt for arm64 tests + a empty dockerd instance you can finish them exactly once without errors. For the second time you need to cleanup dockerd again. > github.com/nektos/act/report/updated_sources/pkg/runner you have an nested act checkout?, obviously this fails as it detects tests inside that folders that fail to compile If you use multiple worktrees, place them outside of the src of act otherwise the `./...` pattern would match them as well
Author
Owner

@ptagl commented on GitHub (Mar 18, 2025):

I've just opened the PR.

About the failing tests, I think I found the cause:

  1. Not sure how the github.com/nektos/act/report folder was created, I needed to remove it
  2. defaults-run test fails because it expects to find more than one shell as the output of echo $SHELL, but the medium Docker image I'm using only contains bash
  3. Similarly, shells/pwsh test fails because pwsh is not available on the medium Docker image

Both 2 and 3 are related to #1991.

<!-- gh-comment-id:2731246587 --> @ptagl commented on GitHub (Mar 18, 2025): I've just opened the PR. About the failing tests, I think I found the cause: 1. Not sure how the `github.com/nektos/act/report` folder was created, I needed to remove it 2. `defaults-run` test fails because it expects to find more than one shell as the output of `echo $SHELL`, but the **_medium Docker image_** I'm using only contains `bash` 3. Similarly, `shells/pwsh` test fails because `pwsh` is not available on the medium Docker image Both 2 and 3 are related to #1991.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1204
No description provided.