[PR #35] [MERGED] Detect workflow event type #1333

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/35
Author: @sosedoff
Created: 2/15/2019
Status: Merged
Merged: 2/17/2019
Merged by: @cplee

Base: masterHead: detect-event-type


📝 Commits (2)

  • 96065fe Detect workflow event type
  • ff2c631 Add extra test for event detection

📊 Changes

4 files changed (+25 additions, -12 deletions)

View changed files

📝 actions/runner.go (+0 -9)
📝 actions/runner_test.go (+1 -0)
actions/testdata/detect_event.workflow (+9 -0)
📝 cmd/root.go (+15 -3)

📄 Description

So this is implementation for my latest comment in #32.
Act will detect the event type from the workflow file only if there's a single workflow in the file.

workflow "test" {
  on = "pull_request"
  resolves = ["task"]
}

task "foo" {
  // ... details
}

When running act it will run all the tasks for the pull_request event. Will add tests as well.


🔄 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/35 **Author:** [@sosedoff](https://github.com/sosedoff) **Created:** 2/15/2019 **Status:** ✅ Merged **Merged:** 2/17/2019 **Merged by:** [@cplee](https://github.com/cplee) **Base:** `master` ← **Head:** `detect-event-type` --- ### 📝 Commits (2) - [`96065fe`](https://github.com/nektos/act/commit/96065fe8079538afe439da8ce2e65149dd992b55) Detect workflow event type - [`ff2c631`](https://github.com/nektos/act/commit/ff2c631d402c48753089d2c2672823544321fb76) Add extra test for event detection ### 📊 Changes **4 files changed** (+25 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `actions/runner.go` (+0 -9) 📝 `actions/runner_test.go` (+1 -0) ➕ `actions/testdata/detect_event.workflow` (+9 -0) 📝 `cmd/root.go` (+15 -3) </details> ### 📄 Description So this is implementation for my latest comment in #32. Act will detect the event type from the workflow file only if there's a single workflow in the file. ``` workflow "test" { on = "pull_request" resolves = ["task"] } task "foo" { // ... details } ``` When running `act` it will run all the tasks for the `pull_request` event. Will add tests as well. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:50:44 +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#1333
No description provided.