[PR #840] [MERGED] fix: continue jobs + steps after failure #1639

Closed
opened 2026-03-01 21:52:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/840
Author: @KnisterPeter
Created: 10/14/2021
Status: Merged
Merged: 12/8/2021
Merged by: @mergify[bot]

Base: masterHead: if-conditions


📝 Commits (10+)

  • 3a2b7af fix: continue jobs + steps after failure
  • cc63c2d style: correct linter warnings
  • 0f0ffbb fix: job if value defaults to success()
  • 0bedbd5 fix: check job needs recursively
  • 0343a4a test: add runner test for job status check functions
  • 9b01130 test: add unit tests for run context if evaluation
  • 8a1d1c3 refactor: move if expression evaluation
  • 0240159 test: add unit tests for step context if evaluation
  • 0715896 fix: handle job error more resilient
  • 6fd63db feat: steps should use a default if expression of success()

📊 Changes

13 files changed (+523 additions, -69 deletions)

View changed files

📝 pkg/common/executor.go (+4 -5)
pkg/common/job_error.go (+30 -0)
📝 pkg/model/planner.go (+3 -0)
📝 pkg/model/workflow.go (+4 -0)
📝 pkg/runner/expression.go (+140 -5)
📝 pkg/runner/run_context.go (+27 -55)
📝 pkg/runner/run_context_test.go (+139 -2)
📝 pkg/runner/runner.go (+15 -2)
📝 pkg/runner/runner_test.go (+2 -0)
📝 pkg/runner/step_context.go (+15 -0)
📝 pkg/runner/step_context_test.go (+87 -0)
pkg/runner/testdata/if-expressions/push.yml (+29 -0)
pkg/runner/testdata/job-status-check/push.yml (+28 -0)

📄 Description

To allow proper if expression handling on jobs and steps (like always,
success, failure, ...) we need to continue running all executors in
the prepared chain.
To keep the error handling intact we add an occurred error to the
go context and handle it later in the pipeline/chain.

Also we add the job result to the needs context to give expressions
access to it.
The needs object, failure and success functions are split between
run context (on jobs) and step context.

Closes #442


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/840 **Author:** [@KnisterPeter](https://github.com/KnisterPeter) **Created:** 10/14/2021 **Status:** ✅ Merged **Merged:** 12/8/2021 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `if-conditions` --- ### 📝 Commits (10+) - [`3a2b7af`](https://github.com/nektos/act/commit/3a2b7af272b9f2ff46f9f171f415ab4b836f6a32) fix: continue jobs + steps after failure - [`cc63c2d`](https://github.com/nektos/act/commit/cc63c2d7c929c33c0f33a75df349f0212aa4a296) style: correct linter warnings - [`0f0ffbb`](https://github.com/nektos/act/commit/0f0ffbb60acb8cf8d5d53072871a3545e7868b04) fix: job if value defaults to success() - [`0bedbd5`](https://github.com/nektos/act/commit/0bedbd567a35d1930ba4542a5443952c6ba75ea8) fix: check job needs recursively - [`0343a4a`](https://github.com/nektos/act/commit/0343a4a0770d2fde967253bd39575270fc3cff97) test: add runner test for job status check functions - [`9b01130`](https://github.com/nektos/act/commit/9b011301c973ad9716c001a7e07917a455fd0f92) test: add unit tests for run context if evaluation - [`8a1d1c3`](https://github.com/nektos/act/commit/8a1d1c3e43dfaad8c40c2c6c2ce89a05a56670b9) refactor: move if expression evaluation - [`0240159`](https://github.com/nektos/act/commit/0240159fde7fd256c00f9ac2e94925f27c688529) test: add unit tests for step context if evaluation - [`0715896`](https://github.com/nektos/act/commit/0715896a488b630b97e0e72097b187998b7c2bbb) fix: handle job error more resilient - [`6fd63db`](https://github.com/nektos/act/commit/6fd63db54068164b2e49128e98864a3df492cf12) feat: steps should use a default if expression of success() ### 📊 Changes **13 files changed** (+523 additions, -69 deletions) <details> <summary>View changed files</summary> 📝 `pkg/common/executor.go` (+4 -5) ➕ `pkg/common/job_error.go` (+30 -0) 📝 `pkg/model/planner.go` (+3 -0) 📝 `pkg/model/workflow.go` (+4 -0) 📝 `pkg/runner/expression.go` (+140 -5) 📝 `pkg/runner/run_context.go` (+27 -55) 📝 `pkg/runner/run_context_test.go` (+139 -2) 📝 `pkg/runner/runner.go` (+15 -2) 📝 `pkg/runner/runner_test.go` (+2 -0) 📝 `pkg/runner/step_context.go` (+15 -0) 📝 `pkg/runner/step_context_test.go` (+87 -0) ➕ `pkg/runner/testdata/if-expressions/push.yml` (+29 -0) ➕ `pkg/runner/testdata/job-status-check/push.yml` (+28 -0) </details> ### 📄 Description To allow proper if expression handling on jobs and steps (like always, success, failure, ...) we need to continue running all executors in the prepared chain. To keep the error handling intact we add an occurred error to the go context and handle it later in the pipeline/chain. Also we add the job result to the needs context to give expressions access to it. The needs object, failure and success functions are split between run context (on jobs) and step context. Closes #442 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:52:02 +03:00
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#1639
No description provided.