From 643f8d08b78fe8035e84367772e11a1862b3b78b Mon Sep 17 00:00:00 2001 From: Jacob Turner Date: Fri, 6 Mar 2020 18:05:36 -0700 Subject: [PATCH] Add event documentation (#137) --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 4c9b2b8..5cab9d3 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,27 @@ Additionally, act support loading environment variables from a `.env` file. The act --env-file my.env ``` +# Events +Every [Github event](https://developer.github.com/v3/activity/events/types) is accompanied with a payload. You can provide these events in JSON format with the `--eventpath` to simulate specific Github events kicking off an action. For example: + +``` pull-request.json +{ + "pull_request": { + "head": { + "ref": "sample-head-ref" + }, + "base": { + "ref": "sample-base-ref" + } + } +} +``` +``` +act -e pull-request.json +``` + +Act will properly provide `github.head_ref` and `github.base_ref` to the action as expected. + # Support Need help? Ask on [Gitter](https://gitter.im/nektos/act)!