[PR #866] [CLOSED] Add action post, post-if support #1653

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/866
Author: @sp-ricard-valverde
Created: 11/10/2021
Status: Closed

Base: masterHead: feat/add-post-events


📝 Commits (10+)

  • 79a3a13 fix(deps): missing hash
  • 6eafa5b feat(data): parse new action fields
  • 9fc768f feat(executor): add NewFinallyPipelineExecutor
  • f440c8c feat(run_context): add PostActionExecutor
  • 560ea62 feat(provider): add ActionProvider
  • d0697b9 feat(provider): use ActionProvider
  • 8c2f722 feat(provider): implement SetupAction
  • 97330f7 feat(provider): implement RunAction
  • 1890f86 feat(provider): implement execute methods
  • 22e7e46 test(runner): add post action tests

📊 Changes

46 files changed (+12824 additions, -221 deletions)

View changed files

📝 .github/dependabot.yml (+6 -6)
📝 CONTRIBUTING.md (+2 -2)
📝 README.md (+3 -3)
📝 cmd/root.go (+4 -1)
📝 go.mod (+1 -0)
📝 go.sum (+3 -0)
📝 pkg/artifacts/server_test.go (+30 -26)
📝 pkg/common/executor.go (+19 -0)
📝 pkg/model/action.go (+6 -0)
📝 pkg/runner/command.go (+3 -0)
📝 pkg/runner/command_test.go (+11 -0)
pkg/runner/provider.go (+246 -0)
📝 pkg/runner/run_context.go (+28 -16)
📝 pkg/runner/runner.go (+9 -2)
📝 pkg/runner/runner_test.go (+134 -3)
📝 pkg/runner/step_context.go (+6 -162)
pkg/runner/testdata/actions/post/node12-post-if-always-2/action.yml (+6 -0)
pkg/runner/testdata/actions/post/node12-post-if-always-2/index.js (+5 -0)
pkg/runner/testdata/actions/post/node12-post-if-always-3/action.yml (+6 -0)
pkg/runner/testdata/actions/post/node12-post-if-always-3/index.js (+5 -0)

...and 26 more files

📄 Description

fixes #626

Support for running actions that define post steps with or without post-if conditions

Made changes to support dependency injection for modeling Actions by using and implementing ActionProviders, this allows for improved mocking and testing Actions

Because this PR was first aimed at giving support to https://github.com/actions/cache , a simple local cache server is also provided in the form of a Docker image (necessary for the cache action to work properly)


🔄 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/866 **Author:** [@sp-ricard-valverde](https://github.com/sp-ricard-valverde) **Created:** 11/10/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feat/add-post-events` --- ### 📝 Commits (10+) - [`79a3a13`](https://github.com/nektos/act/commit/79a3a13ddf2bfbfbd52a8fe3b7963ad255aebbbe) fix(deps): missing hash - [`6eafa5b`](https://github.com/nektos/act/commit/6eafa5b59f038455b7e25ee4efcada924dba6c80) feat(data): parse new action fields - [`9fc768f`](https://github.com/nektos/act/commit/9fc768f04c5f98a9281a0198ffc956c761f4165f) feat(executor): add NewFinallyPipelineExecutor - [`f440c8c`](https://github.com/nektos/act/commit/f440c8ce4ff8d32fb623acbd79a85f63f2b73576) feat(run_context): add PostActionExecutor - [`560ea62`](https://github.com/nektos/act/commit/560ea62d7eec7963f59ad807d2a72c88a2f07ace) feat(provider): add ActionProvider - [`d0697b9`](https://github.com/nektos/act/commit/d0697b908a29e87bc8283d2c078fbd1ec6204ff9) feat(provider): use `ActionProvider` - [`8c2f722`](https://github.com/nektos/act/commit/8c2f7228c966f9ac6e7634f23823a42441845473) feat(provider): implement `SetupAction` - [`97330f7`](https://github.com/nektos/act/commit/97330f7b3fa9ef215607347cca62967527a8c453) feat(provider): implement `RunAction` - [`1890f86`](https://github.com/nektos/act/commit/1890f8603e62ee95efb492dbe37e332edd46e0a2) feat(provider): implement execute methods - [`22e7e46`](https://github.com/nektos/act/commit/22e7e46daa7eb909af11c6f2f93c32e9323af9a1) test(runner): add post action tests ### 📊 Changes **46 files changed** (+12824 additions, -221 deletions) <details> <summary>View changed files</summary> 📝 `.github/dependabot.yml` (+6 -6) 📝 `CONTRIBUTING.md` (+2 -2) 📝 `README.md` (+3 -3) 📝 `cmd/root.go` (+4 -1) 📝 `go.mod` (+1 -0) 📝 `go.sum` (+3 -0) 📝 `pkg/artifacts/server_test.go` (+30 -26) 📝 `pkg/common/executor.go` (+19 -0) 📝 `pkg/model/action.go` (+6 -0) 📝 `pkg/runner/command.go` (+3 -0) 📝 `pkg/runner/command_test.go` (+11 -0) ➕ `pkg/runner/provider.go` (+246 -0) 📝 `pkg/runner/run_context.go` (+28 -16) 📝 `pkg/runner/runner.go` (+9 -2) 📝 `pkg/runner/runner_test.go` (+134 -3) 📝 `pkg/runner/step_context.go` (+6 -162) ➕ `pkg/runner/testdata/actions/post/node12-post-if-always-2/action.yml` (+6 -0) ➕ `pkg/runner/testdata/actions/post/node12-post-if-always-2/index.js` (+5 -0) ➕ `pkg/runner/testdata/actions/post/node12-post-if-always-3/action.yml` (+6 -0) ➕ `pkg/runner/testdata/actions/post/node12-post-if-always-3/index.js` (+5 -0) _...and 26 more files_ </details> ### 📄 Description fixes #626 Support for running actions that define `post` steps with or without `post-if` conditions Made changes to support dependency injection for modeling Actions by using and implementing ActionProviders, this allows for improved mocking and testing Actions Because this PR was first aimed at giving support to https://github.com/actions/cache , a [simple local cache server is also provided in the form of a Docker image](https://github.com/sp-ricard-valverde/github-act-cache-server) (necessary for the cache action to work properly) --- <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:06 +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#1653
No description provided.