[GH-ISSUE #32] Error: unsupported event: push #16

Closed
opened 2026-03-01 21:39:09 +03:00 by kerem · 8 comments
Owner

Originally created by @sosedoff on GitHub (Feb 13, 2019).
Original GitHub issue: https://github.com/nektos/act/issues/32

I'm playing around with an action that runs when a PR is created, however with act command i'm getting this error (running act):

Error: unsupported event: push

Example workflow file:

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

action "build" {
  uses = "./pull-request-action"
}

Im not sure why the error refers to push event

Originally created by @sosedoff on GitHub (Feb 13, 2019). Original GitHub issue: https://github.com/nektos/act/issues/32 I'm playing around with an action that runs when a PR is created, however with `act` command i'm getting this error (running `act`): ``` Error: unsupported event: push ``` Example workflow file: ``` workflow "test" { on = "pull_request" resolves = ["build"] } action "build" { uses = "./pull-request-action" } ``` Im not sure why the error refers to `push` event
kerem closed this issue 2026-03-01 21:39:09 +03:00
Author
Owner

@sosedoff commented on GitHub (Feb 13, 2019):

Just realized that act uses push as a default event. When i execute act pull_request everything works as expected.

Perhaps act could check the workflow file for the event type and run it instead of using a default push event.

<!-- gh-comment-id:463325251 --> @sosedoff commented on GitHub (Feb 13, 2019): Just realized that `act` uses `push` as a default event. When i execute `act pull_request` everything works as expected. Perhaps `act` could check the workflow file for the event type and run it instead of using a default `push` event.
Author
Owner

@cplee commented on GitHub (Feb 14, 2019):

@sosedoff this was intentional, based on the fact that GH actions uses the push event as the default as per the docs

image

<!-- gh-comment-id:463480583 --> @cplee commented on GitHub (Feb 14, 2019): @sosedoff this was intentional, based on the fact that GH actions uses the `push` event as the default as per the [docs](https://developer.github.com/actions/creating-workflows/workflow-configuration-options/#events-supported-in-workflow-files) ![image](https://user-images.githubusercontent.com/2239057/52761947-7ba4f280-2fe3-11e9-93b6-c85af6f4dd1c.png)
Author
Owner

@cplee commented on GitHub (Feb 14, 2019):

I'd be open for a PR if you have something else in mind!

<!-- gh-comment-id:463480695 --> @cplee commented on GitHub (Feb 14, 2019): I'd be open for a PR if you have something else in mind!
Author
Owner

@sosedoff commented on GitHub (Feb 14, 2019):

Yeah, i'll experiment a bit on this front. Also, i think i had an older version of act installed, once i updated it no longer printed any errors and terminated silently.

<!-- gh-comment-id:463773482 --> @sosedoff commented on GitHub (Feb 14, 2019): Yeah, i'll experiment a bit on this front. Also, i think i had an older version of `act` installed, once i updated it no longer printed any errors and terminated silently.
Author
Owner

@mcolyer commented on GitHub (Feb 14, 2019):

@sosedoff this was intentional, based on the fact that GH actions uses the push event as the default as per the docs

This might have been unintentional on our part. I believe we used the word default here to mean that it's the default event that is selected within the workflow editor. It doesn't really have any significance beyond that. Having support for other events in act is definitely encouraged.

<!-- gh-comment-id:463824808 --> @mcolyer commented on GitHub (Feb 14, 2019): > @sosedoff this was intentional, based on the fact that GH actions uses the `push` event as the default as per the [docs](https://developer.github.com/actions/creating-workflows/workflow-configuration-options/#events-supported-in-workflow-files) This might have been unintentional on our part. I believe we used the word default here to mean that it's the default event that is selected within the workflow editor. It doesn't really have any significance beyond that. Having support for other events in `act` is definitely encouraged.
Author
Owner

@cplee commented on GitHub (Feb 14, 2019):

So act does support running other events, but I do like @sosedoff suggestion. Let's keep this open and implement.

<!-- gh-comment-id:463846990 --> @cplee commented on GitHub (Feb 14, 2019): So `act` does support running other events, but I do like @sosedoff suggestion. Let's keep this open and implement.
Author
Owner

@sosedoff commented on GitHub (Feb 15, 2019):

Ok so i played with workflows a bit more and realized that you can actually have more than one workflow in the same file triggered on the same event (push). Im thinking act could do the following (to eliminate extra typing):

  • Read the workflow file
  • If the workflow file contains only a single workflow - detect the event type
  • If user did not provide an event we could use the value defined with on instead of default push

So if i had a workflow like this:

workflow "dummy" {
  on = "pull_request"
  resolves = ["task"]
}
// ...

Running act would result in equivalent of act pull_request. If there are more than one type of events defined in the workflow act would use the existing behavior.

<!-- gh-comment-id:464099033 --> @sosedoff commented on GitHub (Feb 15, 2019): Ok so i played with workflows a bit more and realized that you can actually have more than one workflow in the same file triggered on the same event (`push`). Im thinking `act` could do the following (to eliminate extra typing): - Read the workflow file - If the workflow file contains only a single workflow - detect the event type - If user did not provide an event we could use the value defined with `on` instead of default `push` So if i had a workflow like this: ``` workflow "dummy" { on = "pull_request" resolves = ["task"] } // ... ``` Running `act` would result in equivalent of `act pull_request`. If there are more than one type of events defined in the workflow `act` would use the existing behavior.
Author
Owner

@cplee commented on GitHub (Feb 17, 2019):

fixed with #35

<!-- gh-comment-id:464404361 --> @cplee commented on GitHub (Feb 17, 2019): fixed with #35
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#16
No description provided.