58 Commits

Author SHA1 Message Date
248cda557c Use Octokit pagination 2022-10-11 23:48:07 +02:00
ce8f47aa7f Fix incorrect handling of Unicode characters in exec() 2022-10-11 23:01:54 +02:00
af2564d3e0 Fix #90 getLocalRef() returns wrong ref
git show-ref will return all branches where end segment matches the input. This cause issues when there are both 'someBranch' and 'somePrefix/someBranch' branches. This fix ensures the correct ref is returned by explicitly matching segments after common parts (e.g. refs/heads).
2021-06-14 10:20:58 +02:00
e59743163d Fix unnecessary calls to getLocalRef() 2021-04-12 22:46:34 +02:00
78b1672eeb Fix missing await 2021-04-12 22:31:38 +02:00
f1c461fccf Fix logging inside ensureRefAvailable() 2021-04-12 22:22:57 +02:00
0b18612ac3 Improve support for PR events + verify base and ref are used correctly 2021-04-12 16:29:29 +02:00
d0507d9a8a Improve log output 2021-04-11 21:39:09 +02:00
8d029eb508 Fix change detection in PR when pullRequest.changed_files was incorrect 2021-04-11 21:15:30 +02:00
58ed00ec48 Update README 2021-04-11 20:49:05 +02:00
02eeef4973 Fix undefined instead of ref in log output 2021-04-07 22:41:22 +02:00
37a6d38b2d Add ref input parameter 2021-04-07 22:32:59 +02:00
208adf42c8 Ignore error when some tag on remote was updated 2021-03-29 17:09:18 +02:00
a6989ad592 Get full ref name without multiple invocations to git show-ref 2021-03-26 00:05:48 +01:00
6d8169070c Improve logging 2021-03-25 23:45:44 +01:00
3d4a25053b Update dist 2021-03-25 23:39:10 +01:00
e59197f91b Fix change detection when base is tag 2021-03-25 23:34:50 +01:00
138368ff4f Use ref instead of HEAD 2021-03-09 21:56:18 +01:00
a301a0ad83 Refactor getChangesSinceMergeBase() code 2021-03-09 21:44:15 +01:00
0c0d1a854a Fetch base and search merge-base without creating local branch 2021-03-09 21:13:57 +01:00
49abb091ed Use combination of --depth and --deepen 2021-03-08 17:00:52 +01:00
8801c887e9 Do not try to update head of current branch 2021-03-08 15:29:27 +01:00
68792bf56a Allow single line filters 2021-03-08 15:24:06 +01:00
31c576896e Fix lastCommitCount has not been updated 2021-03-08 15:12:58 +01:00
3be8c93277 Fix fetching git history + fallback to unshallow repo 2021-03-08 15:09:07 +01:00
b5fa2d5c02 Add list-files: csv format 2021-02-20 11:21:30 +01:00
c2766acabb Add ${FILTER_NAME}_count output 2021-01-29 19:54:44 +01:00
2c79a825c0 Fix grouping 2021-01-26 12:22:37 +01:00
9e8c9af501 Add "changes" output variable to support matrix job configuration 2020-12-17 22:33:11 +01:00
e4d886f503 Provide shell and escape options when formatting matching files 2020-12-17 22:13:28 +01:00
ada1eee648 Simplify shell escaping - escape chars instead of quoting whole string 2020-12-17 22:13:28 +01:00
1934d574ce Support local changes 2020-11-22 20:59:32 +01:00
d599443ba5 Fix change detection using Github API (#51) 2020-11-13 20:15:41 +01:00
785a14adbe fix: add missing Octokit import 2020-11-13 17:30:27 +01:00
e84bc6af29 fix: retrieve all changes via api
the number returned by pullRequest.changed_files doesn't reflect the correct number of real changed files. Therefore lot of filters didn't work in my scenario, as it said nothing has changed. This especially happens if there are more than 100 files changed (first time I experienced it where over 1000 files have changed, and now when there were about 300 files that have changed). 

I changed the detection by querying the api as long as it returns new results. This ensures all pages have been retrieved. It's tested and used in production on our end, but please check again if I didn't miss anything.

Thanks a lot for this awesome github action :)
2020-11-13 17:28:22 +01:00
b4eabb6049 Use picomatch + impl followups from #48 2020-11-09 00:45:53 +01:00
5282566eab feat: Add support for multiple patterns when using file status
This adds support for using multiple patterns when checking for file status (added, modified, deleted) and as a result also allows you to use YAML anchors.
2020-11-06 17:41:51 -08:00
b37d4e9e86 Use micromatch instead of minimatch (#46)
* Use micromatch instead of minimatch

micromatch claims to support full Bash 4.3 spec and it actually passes all the tests. 
For example this fixes processing of '!(**/*.tsx|**/*.less)' pattern - needed by #45

* Update CHANGELOG.md
2020-10-23 12:33:44 +02:00
75cbfb4be9 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
2020-10-16 12:28:12 +02:00
9553dabbd8 Remove usage of --no-auto-gc option (#42)
* Remove usage of --no-auto-gc option

This option is not supported in git versions < 2.23.
Older git versions might be used in self-hosted runners.

* Update CHANGELOG
2020-10-06 13:38:18 +02:00
ff5bb057bf v2.4.0 - support local execution with act + allow tags (#40)
* Avoid code repetition with exec() and output listeners

* Improve behavior for new branches and when it's running in ACT

* Detect parent commit only if needed

* Fix parent commit detection for initial commit

* Improve logging

* Improve current ref detection

* Fix issue when base is a already fetched tag

* Fix issue when base is a already fetched tag

* Update README

* Document usage with act

* Use `git log` to get changes in latest commit

* Disable other output for `git log`

* get short name from base ref + improve loggig

* update CHANGELOG
2020-09-30 00:32:49 +02:00
81c90ccae8 Change detection using git "three dot" diff (#35)
* Rework change detection via `git diff`

Previous implementation performed simple diff between two versions. New implementation fetches on demand more commits to have the merge base between two branches. Now it will detect only changes introduced by branch that was pushed, instead of mixing with changes introduced meanwhile on the base branch.
2020-09-01 22:47:38 +02:00
3f845744aa Export files matching rules (#32)
* Export files matching rules

* Improve debug output

* Fix PR test workflow

* Always quote output path + fix PR test

* Use proper single quote escaping in workflow file

* Improve error handling and docs for list-files input parameter
2020-08-30 21:18:14 +02:00
483986d0a7 Merge branch 'master' into develop 2020-08-14 22:03:31 +02:00
b365bd8768 Update main.ts (#29)
Add support for the new `pull_request_target` event.
https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target
2020-08-13 21:44:57 +02:00
f34047f516 Export changed files grouped by change status (#23) 2020-08-04 20:57:29 +02:00
1ff702da35 Extend filter syntax with optional specification of file status: add, modified, deleted (#22)
* Add support for specification of change type (add,modified,delete)

* Use NULL as separator in git-diff command output

* Improve PR test workflow

* Fix the workflow file
2020-08-04 20:57:29 +02:00
caef9bef1f Add working-directory input (#21) 2020-08-04 20:57:29 +02:00
83deb9f037 Improve change detection for feature branches (#16)
* Detect changes against configured base branch

* Update README and action.yml

* Add job.outputs example

* Update CHANGELOG
2020-06-24 21:53:31 +02:00
7d201829e2 Support reusable paths blocks via yaml anchors (#13)
* Add support for nested arrays of path expressions

* Remove pull_request trigger type options

Default value is fine: opened, synchronize, reopened

* Add CHANGELOG

* Update README
2020-06-19 23:39:06 +02:00