From 58ed00ec486f0395621febf08b0b667ad53d469e Mon Sep 17 00:00:00 2001 From: Michal Dorner Date: Sun, 11 Apr 2021 20:49:05 +0200 Subject: [PATCH] Update README --- README.md | 11 ++++++++--- dist/index.js | 2 +- src/git.ts | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e78b1a0..1c963a8 100644 --- a/README.md +++ b/README.md @@ -66,13 +66,11 @@ For more scenarios see [examples](#examples) section. # What's New +- Add `ref` input parameter - Add `list-files: csv` format - Configure matrix job to run for each folder with changes using `changes` output - Improved listing of matching files with `list-files: shell` and `list-files: escape` options -- Support local changes -- Fixed retrieval of all changes via Github API when there are 100+ changes - Paths expressions are now evaluated using [picomatch](https://github.com/micromatch/picomatch) library -- Support workflows triggered by any event For more information see [CHANGELOG](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md) @@ -111,6 +109,13 @@ For more information see [CHANGELOG](https://github.com/dorny/paths-filter/blob/ # Default: repository default branch (e.g. master) base: '' + # Git reference (e.g. branch name) from which the changes will be detected. + # Useful when workflow can be triggered only on default branch (e.g. repository_dispatch event) + # but you want to get changes on different branch. + # This option is ignored if action is triggered by pull_request event. + # default: ${{ github.ref }} + ref: + # How many commits are initially fetched from base branch. # If needed, each subsequent fetch doubles the # previously requested number of commits until the merge-base diff --git a/dist/index.js b/dist/index.js index ea9a243..5682bc6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3920,6 +3920,7 @@ async function getChangesSinceMergeBase(base, head, initialFetchDepth) { finally { core.endGroup(); } + // Three dots '...' change detection - finds merge-base and compares against it let diffArg = `${baseRef}...${headRef}`; if (noMergeBase) { core.warning('No merge base found - change detection will use direct .. comparison'); @@ -3929,7 +3930,6 @@ async function getChangesSinceMergeBase(base, head, initialFetchDepth) { core.startGroup(`Change detection ${diffArg}`); let output = ''; try { - // Three dots '...' change detection - finds merge-base and compares against it output = (await exec_1.default('git', ['diff', '--no-renames', '--name-status', '-z', diffArg])).stdout; } finally { diff --git a/src/git.ts b/src/git.ts index 809249d..df56308 100644 --- a/src/git.ts +++ b/src/git.ts @@ -111,6 +111,7 @@ export async function getChangesSinceMergeBase(base: string, head: string, initi core.endGroup() } + // Three dots '...' change detection - finds merge-base and compares against it let diffArg = `${baseRef}...${headRef}` if (noMergeBase) { core.warning('No merge base found - change detection will use direct .. comparison') @@ -121,7 +122,6 @@ export async function getChangesSinceMergeBase(base: string, head: string, initi core.startGroup(`Change detection ${diffArg}`) let output = '' try { - // Three dots '...' change detection - finds merge-base and compares against it output = (await exec('git', ['diff', '--no-renames', '--name-status', '-z', diffArg])).stdout } finally { fixStdOutNullTermination()