Support workflows triggered by any event (#44)

* Allow change detection on all event types

* mention commit SHA in docs for base parameter

* improve logging

* update CHANGELOG.md
This commit is contained in:
Michal Dorner
2020-10-16 12:28:12 +02:00
committed by GitHub
parent 9bd03c0d68
commit 75cbfb4be9
6 changed files with 71 additions and 43 deletions

View File

@ -9,18 +9,27 @@ doesn't allow this because they doesn't work on a level of individual jobs or st
## Supported workflows:
- Pull requests:
- Action triggered by **[pull_request](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request)**
- **Pull requests:**
- Workflow triggered by **[pull_request](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request)**
or **[pull_request_target](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target)** event
- Changes are detected against the pull request base branch
- Uses Github REST API to fetch list of modified files
- Feature branches:
- Action triggered by **[push](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)** event
- Changes are detected against the merge-base with configured base branch
- **Feature branches:**
- Workflow triggered by **[push](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)**
or any other **[event](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows)**
- The `base` input parameter must not be the same as the branch that triggered the workflow
- Changes are detected against the merge-base with configured base branch or default branch
- Uses git commands to detect changes - repository must be already [checked out](https://github.com/actions/checkout)
- Master, Release or other long-lived branches:
- Action triggered by **[push](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)** event
- Changes are detected against the most recent commit on the same branch before the push
- **Master, Release or other long-lived branches:**
- Workflow triggered by **[push](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)** event
when `base` input parameter is same as the branch that triggered the workflow:
- Changes are detected against the most recent commit on the same branch before the push
- Workflow triggered by any other **[event](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows)**
when `base` input parameter is commit SHA:
- Changes are detected against the provided `base` commit
- Workflow triggered by any other **[event](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows)**
when `base` input parameter is same as the branch that triggered the workflow:
- Changes are detected from last commit
- Uses git commands to detect changes - repository must be already [checked out](https://github.com/actions/checkout)
## Example
@ -49,6 +58,7 @@ For more scenarios see [examples](#examples) section.
# What's New
- Support workflows triggered by any event
- Fixed compatibility with older (<2.23) versions of git
- Support for tag pushes and tags as a base reference
- Fixes for various edge cases when event payload is incomplete
@ -57,9 +67,6 @@ For more scenarios see [examples](#examples) section.
- Detects only changes introduced by feature branch. Later modifications on base branch are ignored.
- Filter by type of file change:
- Optionally consider if file was added, modified or deleted
- Custom processing of changed files:
- Optionally export paths of all files matching the filter
- Output can be space-delimited or in JSON format
For more information see [CHANGELOG](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
@ -85,7 +92,7 @@ For more information see [CHANGELOG](https://github.com/actions/checkout/blob/ma
# Filters syntax is documented by example - see examples section.
filters: ''
# Branch or tag against which the changes will be detected.
# Branch, tag or commit SHA against which the changes will be detected.
# If it references same branch it was pushed to,
# changes are detected against the most recent commit before the push.
# Otherwise it uses git merge-base to find best common ancestor between