[PR #1089] [MERGED] implement pre and post steps #1770

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1089
Author: @KnisterPeter
Created: 3/30/2022
Status: Merged
Merged: 5/24/2022
Merged by: @mergify[bot]

Base: masterHead: implement-pre-and-post-steps


📝 Commits (10+)

  • 27d0748 feat: add post step to actions and add state command
  • 309c220 feat: collect pre and post steps for composite actions
  • 5e10328 refactor: move composite action logic into own file
  • c4bb145 refactor: restructure composite handling
  • 3d9f688 feat: run composite post steps during post step lifecycle
  • 95e42cc refactor: remove duplicate log output
  • 209730e feat: run all composite post actions in a step
  • 4c79e48 refactor: remove unused lines of code
  • df96968 refactor: simplify test expression
  • 6cce8a9 fix: use composite job logger

📊 Changes

37 files changed (+1551 additions, -341 deletions)

View changed files

📝 pkg/exprparser/functions_test.go (+8 -8)
📝 pkg/exprparser/interpreter.go (+30 -6)
📝 pkg/exprparser/interpreter_test.go (+5 -5)
📝 pkg/model/action.go (+12 -0)
📝 pkg/model/step_result.go (+1 -0)
📝 pkg/runner/action.go (+212 -142)
pkg/runner/action_composite.go (+195 -0)
📝 pkg/runner/action_test.go (+61 -9)
📝 pkg/runner/command.go (+15 -0)
📝 pkg/runner/command_test.go (+18 -0)
📝 pkg/runner/expression.go (+7 -7)
📝 pkg/runner/expression_test.go (+3 -2)
📝 pkg/runner/job_executor.go (+12 -5)
📝 pkg/runner/run_context.go (+2 -1)
📝 pkg/runner/run_context_test.go (+2 -1)
📝 pkg/runner/runner_test.go (+1 -0)
📝 pkg/runner/step.go (+53 -10)
📝 pkg/runner/step_action_local.go (+49 -18)
📝 pkg/runner/step_action_local_test.go (+237 -5)
📝 pkg/runner/step_action_remote.go (+104 -56)

...and 17 more files

📄 Description

This is a continuation of https://github.com/nektos/act/pull/1010

This change implements action post step in combination with the save-state command.
It does support the post-if condition.

There are a few preparations for action pre steps, but it's not fully implemented in this PR.

Closes #626


🔄 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/1089 **Author:** [@KnisterPeter](https://github.com/KnisterPeter) **Created:** 3/30/2022 **Status:** ✅ Merged **Merged:** 5/24/2022 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `implement-pre-and-post-steps` --- ### 📝 Commits (10+) - [`27d0748`](https://github.com/nektos/act/commit/27d0748b89c3d1691b00b27fbb38fdb2a04b8aa9) feat: add post step to actions and add state command - [`309c220`](https://github.com/nektos/act/commit/309c220a84d897b9ee81cb7d24d2011b6d9ed5f6) feat: collect pre and post steps for composite actions - [`5e10328`](https://github.com/nektos/act/commit/5e10328a3312dc5e4ef91c51ba1f1e23227bc7e8) refactor: move composite action logic into own file - [`c4bb145`](https://github.com/nektos/act/commit/c4bb145921025b5e664a0edb6fd898c04a35356e) refactor: restructure composite handling - [`3d9f688`](https://github.com/nektos/act/commit/3d9f688c2f0fe63aa33779748e14ec97e05ac327) feat: run composite post steps during post step lifecycle - [`95e42cc`](https://github.com/nektos/act/commit/95e42ccd04a73086f20968c54bf80ca87f014fef) refactor: remove duplicate log output - [`209730e`](https://github.com/nektos/act/commit/209730e953c4acc69e421c79d083dbde0c21b025) feat: run all composite post actions in a step - [`4c79e48`](https://github.com/nektos/act/commit/4c79e480062ab41594537d151f286d2bcfda782e) refactor: remove unused lines of code - [`df96968`](https://github.com/nektos/act/commit/df969683403a3cf407d520e202672a67ab3a1fde) refactor: simplify test expression - [`6cce8a9`](https://github.com/nektos/act/commit/6cce8a9ce37cfd3df56f4abc0f5d51d65a2b2fc3) fix: use composite job logger ### 📊 Changes **37 files changed** (+1551 additions, -341 deletions) <details> <summary>View changed files</summary> 📝 `pkg/exprparser/functions_test.go` (+8 -8) 📝 `pkg/exprparser/interpreter.go` (+30 -6) 📝 `pkg/exprparser/interpreter_test.go` (+5 -5) 📝 `pkg/model/action.go` (+12 -0) 📝 `pkg/model/step_result.go` (+1 -0) 📝 `pkg/runner/action.go` (+212 -142) ➕ `pkg/runner/action_composite.go` (+195 -0) 📝 `pkg/runner/action_test.go` (+61 -9) 📝 `pkg/runner/command.go` (+15 -0) 📝 `pkg/runner/command_test.go` (+18 -0) 📝 `pkg/runner/expression.go` (+7 -7) 📝 `pkg/runner/expression_test.go` (+3 -2) 📝 `pkg/runner/job_executor.go` (+12 -5) 📝 `pkg/runner/run_context.go` (+2 -1) 📝 `pkg/runner/run_context_test.go` (+2 -1) 📝 `pkg/runner/runner_test.go` (+1 -0) 📝 `pkg/runner/step.go` (+53 -10) 📝 `pkg/runner/step_action_local.go` (+49 -18) 📝 `pkg/runner/step_action_local_test.go` (+237 -5) 📝 `pkg/runner/step_action_remote.go` (+104 -56) _...and 17 more files_ </details> ### 📄 Description This is a continuation of https://github.com/nektos/act/pull/1010 This change implements [action post step](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost) in combination with the [save-state command](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions). It does support the `post-if` condition. There are a few preparations for action pre steps, but it's not fully implemented in this PR. Closes #626 --- <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:36 +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#1770
No description provided.