[PR #861] [CLOSED] Implement support for pre-/post-actions #1652

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/861
Author: @ZauberNerd
Created: 11/2/2021
Status: Closed

Base: masterHead: pre-post


📝 Commits (4)

  • 4aa604a test: add testdata for pre/post actions
  • abcc154 test: temporarily load remote action from xing/act...@pre-post
  • ed756d0 feat: implement pre and post actions
  • 7b95298 test: add integration tests for pre/post actions

📊 Changes

17 files changed (+486 additions, -57 deletions)

View changed files

📝 pkg/model/action.go (+13 -7)
📝 pkg/runner/run_context.go (+55 -19)
📝 pkg/runner/runner_test.go (+107 -0)
📝 pkg/runner/step_context.go (+204 -31)
pkg/runner/testdata/actions/pre-post-if/action.yml (+18 -0)
pkg/runner/testdata/actions/pre-post-if/main.js (+1 -0)
pkg/runner/testdata/actions/pre-post-if/post.js (+5 -0)
pkg/runner/testdata/actions/pre-post-if/pre.js (+5 -0)
pkg/runner/testdata/actions/pre-post/action.yml (+16 -0)
pkg/runner/testdata/actions/pre-post/main.js (+1 -0)
pkg/runner/testdata/actions/pre-post/post.js (+5 -0)
pkg/runner/testdata/actions/pre-post/pre.js (+5 -0)
pkg/runner/testdata/local-action-with-post-step/push.yml (+13 -0)
pkg/runner/testdata/remote-action-with-main-skipped/push.yml (+9 -0)
pkg/runner/testdata/remote-action-with-post-step-failing/push.yml (+10 -0)
pkg/runner/testdata/remote-action-with-pre-and-post-step/push.yml (+9 -0)
pkg/runner/testdata/remote-action-with-pre-step-failing/push.yml (+10 -0)

📄 Description

This PR needs https://github.com/nektos/act/pull/898 and https://github.com/nektos/act/pull/901 to be merged first.

Implemented here are:

  • pre, pre-if for remote JavaScript actions
  • post, post-if for local and remote JavaScript actions

🔄 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/861 **Author:** [@ZauberNerd](https://github.com/ZauberNerd) **Created:** 11/2/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `pre-post` --- ### 📝 Commits (4) - [`4aa604a`](https://github.com/nektos/act/commit/4aa604abeb9ae59a6ccaa504fc17a5af2881b5c7) test: add testdata for pre/post actions - [`abcc154`](https://github.com/nektos/act/commit/abcc1546ee8c6c47a0976217e044bba79866ee14) test: temporarily load remote action from xing/act...@pre-post - [`ed756d0`](https://github.com/nektos/act/commit/ed756d0dc8a8e540893f72795e27d746375c0fb0) feat: implement pre and post actions - [`7b95298`](https://github.com/nektos/act/commit/7b9529887953a1ebe27a708bbed8ada600d92dab) test: add integration tests for pre/post actions ### 📊 Changes **17 files changed** (+486 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `pkg/model/action.go` (+13 -7) 📝 `pkg/runner/run_context.go` (+55 -19) 📝 `pkg/runner/runner_test.go` (+107 -0) 📝 `pkg/runner/step_context.go` (+204 -31) ➕ `pkg/runner/testdata/actions/pre-post-if/action.yml` (+18 -0) ➕ `pkg/runner/testdata/actions/pre-post-if/main.js` (+1 -0) ➕ `pkg/runner/testdata/actions/pre-post-if/post.js` (+5 -0) ➕ `pkg/runner/testdata/actions/pre-post-if/pre.js` (+5 -0) ➕ `pkg/runner/testdata/actions/pre-post/action.yml` (+16 -0) ➕ `pkg/runner/testdata/actions/pre-post/main.js` (+1 -0) ➕ `pkg/runner/testdata/actions/pre-post/post.js` (+5 -0) ➕ `pkg/runner/testdata/actions/pre-post/pre.js` (+5 -0) ➕ `pkg/runner/testdata/local-action-with-post-step/push.yml` (+13 -0) ➕ `pkg/runner/testdata/remote-action-with-main-skipped/push.yml` (+9 -0) ➕ `pkg/runner/testdata/remote-action-with-post-step-failing/push.yml` (+10 -0) ➕ `pkg/runner/testdata/remote-action-with-pre-and-post-step/push.yml` (+9 -0) ➕ `pkg/runner/testdata/remote-action-with-pre-step-failing/push.yml` (+10 -0) </details> ### 📄 Description This PR needs https://github.com/nektos/act/pull/898 and https://github.com/nektos/act/pull/901 to be merged first. Implemented here are: - `pre`, `pre-if` for remote JavaScript actions - `post`, `post-if` for local and remote JavaScript actions --- <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:05 +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#1652
No description provided.