Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0edfedf16d | ||
|
|
42d4eb324d | ||
|
|
205450238e | ||
|
|
c3c25d12b0 | ||
|
|
b77c43beb0 | ||
|
|
8373ec9091 | ||
|
|
944a8b8909 | ||
|
|
a78216810d | ||
|
|
69a29db2d7 | ||
|
|
e4fdf56472 | ||
|
|
582ce2283c | ||
|
|
43886cd0c3 |
51
.github/workflows/manual-test.yml
vendored
Normal file
51
.github/workflows/manual-test.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
name: Manual Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test changed-files
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
max-parallel: 4
|
||||||
|
matrix:
|
||||||
|
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Run changed-files with defaults
|
||||||
|
id: changed-files
|
||||||
|
uses: ./
|
||||||
|
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files.outputs) }}'
|
||||||
|
- name: Run changed-files with glob filtering
|
||||||
|
id: changed-files-glob
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
test/*.txt
|
||||||
|
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files-glob.outputs) }}'
|
||||||
|
|
||||||
|
- name: Run changed-files with glob filtering and all_old_new_renamed_files
|
||||||
|
id: changed-files-glob-all-old-new-renamed-files
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
include_all_old_new_renamed_files: true
|
||||||
|
files: |
|
||||||
|
test/*.txt
|
||||||
|
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files-glob-all-old-new-renamed-files.outputs) }}'
|
||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -300,6 +300,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
base_sha: d1c0ee4
|
base_sha: d1c0ee4
|
||||||
sha: 4d04215
|
sha: 4d04215
|
||||||
|
include_all_old_new_renamed_files: true
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-1.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-1.outputs) }}'
|
||||||
@@ -318,6 +319,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
base_sha: 4d04215
|
base_sha: 4d04215
|
||||||
sha: fe238e6
|
sha: fe238e6
|
||||||
|
include_all_old_new_renamed_files: true
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2.outputs) }}'
|
||||||
|
|||||||
82
HISTORY.md
82
HISTORY.md
@@ -1,5 +1,47 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [v20.2](https://github.com/tj-actions/changed-files/tree/v20.2) (2022-05-24)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v20.1...v20.2)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- \[BUG\] old\_new\_renamed\_files is empty when providing a glob pattern. [\#467](https://github.com/tj-actions/changed-files/issues/467)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- fix: matching renamed files with glob patterns [\#498](https://github.com/tj-actions/changed-files/pull/498) ([jackton1](https://github.com/jackton1))
|
||||||
|
- chore: Improve test coverage [\#497](https://github.com/tj-actions/changed-files/pull/497) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v20.1 [\#496](https://github.com/tj-actions/changed-files/pull/496) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v20.1](https://github.com/tj-actions/changed-files/tree/v20.1) (2022-05-22)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v20...v20.1)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- \[Feature\] Rename `files` -\> `paths` [\#125](https://github.com/tj-actions/changed-files/issues/125)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- \[BUG\] Glob pattern doesn't work for markdown files [\#492](https://github.com/tj-actions/changed-files/issues/492)
|
||||||
|
- \[BUG\] Using the fork point to detect file changes. [\#355](https://github.com/tj-actions/changed-files/issues/355)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- chore: test rename [\#495](https://github.com/tj-actions/changed-files/pull/495) ([jackton1](https://github.com/jackton1))
|
||||||
|
- chore: Update README.md [\#494](https://github.com/tj-actions/changed-files/pull/494) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v20 [\#491](https://github.com/tj-actions/changed-files/pull/491) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v20](https://github.com/tj-actions/changed-files/tree/v20) (2022-05-15)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v19.3...v20)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- fix: bug finding fork point commit and removed unused temp\_changed\_files remote. [\#490](https://github.com/tj-actions/changed-files/pull/490) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v19.3 [\#489](https://github.com/tj-actions/changed-files/pull/489) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v19.3](https://github.com/tj-actions/changed-files/tree/v19.3) (2022-05-14)
|
## [v19.3](https://github.com/tj-actions/changed-files/tree/v19.3) (2022-05-14)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v19.2...v19.3)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v19.2...v19.3)
|
||||||
@@ -13,10 +55,6 @@
|
|||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v19.1...v19.2)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v19.1...v19.2)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
|
||||||
|
|
||||||
- \[Feature\] Provide Original Filename in a Rename [\#467](https://github.com/tj-actions/changed-files/issues/467)
|
|
||||||
|
|
||||||
**Closed issues:**
|
**Closed issues:**
|
||||||
|
|
||||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||||
@@ -459,7 +497,7 @@
|
|||||||
|
|
||||||
## [v13](https://github.com/tj-actions/changed-files/tree/v13) (2022-02-17)
|
## [v13](https://github.com/tj-actions/changed-files/tree/v13) (2022-02-17)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.2...v13)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.0.1...v13)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -478,13 +516,13 @@
|
|||||||
- \[BUG\] wrong result of any\_change output [\#314](https://github.com/tj-actions/changed-files/issues/314)
|
- \[BUG\] wrong result of any\_change output [\#314](https://github.com/tj-actions/changed-files/issues/314)
|
||||||
- \[BUG\] Investigate possible bug using since\_last\_remote\_commit when force pushing changes. [\#303](https://github.com/tj-actions/changed-files/issues/303)
|
- \[BUG\] Investigate possible bug using since\_last\_remote\_commit when force pushing changes. [\#303](https://github.com/tj-actions/changed-files/issues/303)
|
||||||
|
|
||||||
## [v12.2](https://github.com/tj-actions/changed-files/tree/v12.2) (2021-12-30)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.0.1...v12.2)
|
|
||||||
|
|
||||||
## [v2.0.1](https://github.com/tj-actions/changed-files/tree/v2.0.1) (2021-12-30)
|
## [v2.0.1](https://github.com/tj-actions/changed-files/tree/v2.0.1) (2021-12-30)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.1...v2.0.1)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.2...v2.0.1)
|
||||||
|
|
||||||
|
## [v12.2](https://github.com/tj-actions/changed-files/tree/v12.2) (2021-12-30)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.1...v12.2)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
@@ -634,7 +672,7 @@
|
|||||||
|
|
||||||
## [v1.2.1](https://github.com/tj-actions/changed-files/tree/v1.2.1) (2021-11-08)
|
## [v1.2.1](https://github.com/tj-actions/changed-files/tree/v1.2.1) (2021-11-08)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.5...v1.2.1)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.2.0...v1.2.1)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -648,13 +686,13 @@
|
|||||||
- Update actions/checkout action to v2.4.0 [\#243](https://github.com/tj-actions/changed-files/pull/243) ([renovate[bot]](https://github.com/apps/renovate))
|
- Update actions/checkout action to v2.4.0 [\#243](https://github.com/tj-actions/changed-files/pull/243) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
- Upgraded to v11.5 [\#241](https://github.com/tj-actions/changed-files/pull/241) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v11.5 [\#241](https://github.com/tj-actions/changed-files/pull/241) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v11.5](https://github.com/tj-actions/changed-files/tree/v11.5) (2021-10-30)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.2.0...v11.5)
|
|
||||||
|
|
||||||
## [v1.2.0](https://github.com/tj-actions/changed-files/tree/v1.2.0) (2021-10-30)
|
## [v1.2.0](https://github.com/tj-actions/changed-files/tree/v1.2.0) (2021-10-30)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.4...v1.2.0)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.5...v1.2.0)
|
||||||
|
|
||||||
|
## [v11.5](https://github.com/tj-actions/changed-files/tree/v11.5) (2021-10-30)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.4...v11.5)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
@@ -1046,7 +1084,7 @@
|
|||||||
|
|
||||||
## [v7](https://github.com/tj-actions/changed-files/tree/v7) (2021-06-09)
|
## [v7](https://github.com/tj-actions/changed-files/tree/v7) (2021-06-09)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6...v7)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.3...v7)
|
||||||
|
|
||||||
**Closed issues:**
|
**Closed issues:**
|
||||||
|
|
||||||
@@ -1062,13 +1100,13 @@
|
|||||||
- Update tj-actions/sync-release-version action to v8.7 [\#86](https://github.com/tj-actions/changed-files/pull/86) ([renovate[bot]](https://github.com/apps/renovate))
|
- Update tj-actions/sync-release-version action to v8.7 [\#86](https://github.com/tj-actions/changed-files/pull/86) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
- Upgraded to v6.3 [\#85](https://github.com/tj-actions/changed-files/pull/85) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v6.3 [\#85](https://github.com/tj-actions/changed-files/pull/85) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v6](https://github.com/tj-actions/changed-files/tree/v6) (2021-05-26)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.3...v6)
|
|
||||||
|
|
||||||
## [v6.3](https://github.com/tj-actions/changed-files/tree/v6.3) (2021-05-26)
|
## [v6.3](https://github.com/tj-actions/changed-files/tree/v6.3) (2021-05-26)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.2...v6.3)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6...v6.3)
|
||||||
|
|
||||||
|
## [v6](https://github.com/tj-actions/changed-files/tree/v6) (2021-05-26)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.2...v6)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
|||||||
44
README.md
44
README.md
@@ -22,18 +22,17 @@ Retrieve all changed files relative to the target branch (`pull_request*` based
|
|||||||
* Boolean output indicating that certain files have been changed.
|
* Boolean output indicating that certain files have been changed.
|
||||||
* Scales to large repositories.
|
* Scales to large repositories.
|
||||||
* Git submodules support.
|
* Git submodules support.
|
||||||
* Multiple repositories support.
|
* Monorepos (Fetches only the last remote commit).
|
||||||
|
* Supports all platforms (Linux, MacOS, Windows).
|
||||||
* [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners) support
|
* [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners) support
|
||||||
* [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.3/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server) support.
|
* [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.3/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server) support.
|
||||||
* [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) support.
|
* [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) support.
|
||||||
* Monorepos (Fetches only the last remote commit).
|
* List all files that have changed:
|
||||||
* Supports all platforms (Linux, MacOS, Windows).
|
|
||||||
* List all files that have changed.
|
|
||||||
* Between the current pull request branch and the last commit on the target branch.
|
* Between the current pull request branch and the last commit on the target branch.
|
||||||
* Between the current pull request branch and the fork point on the target branch.
|
* Between the current pull request branch and the fork point on the target branch.
|
||||||
* Between the last commit and the current pushed change.
|
* Between the last commit and the current pushed change.
|
||||||
* Between the last remote branch commit and the current HEAD.
|
* Between the last remote branch commit and the current HEAD.
|
||||||
* Restrict change detection to a subset of files.
|
* Restrict change detection to a subset of files:
|
||||||
* Report on files that have at least one change.
|
* Report on files that have at least one change.
|
||||||
* Using [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching.
|
* Using [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching.
|
||||||
|
|
||||||
@@ -68,7 +67,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
|
|
||||||
- name: List all changed files
|
- name: List all changed files
|
||||||
run: |
|
run: |
|
||||||
@@ -114,12 +113,12 @@ Support this project with a :star:
|
|||||||
| all\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed files <br /> i.e. *a combination of all added, <br />copied, modified and renamed files (ACMR)* |
|
| all\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed files <br /> i.e. *a combination of all added, <br />copied, modified and renamed files (ACMR)* |
|
||||||
| all\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed files <br /> i.e. *a combination of all added, <br />copied, modified, renamed and deleted files (ACMRD)* |
|
| all\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed files <br /> i.e. *a combination of all added, <br />copied, modified, renamed and deleted files (ACMRD)* |
|
||||||
| all\_changed\_and\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed <br /> and modified files <br /> i.e. *a combination of (ACMRDTUX)* |
|
| all\_changed\_and\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed <br /> and modified files <br /> i.e. *a combination of (ACMRDTUX)* |
|
||||||
|
| all\_old\_new\_renamed\_files | `string` | `'old name.txt,new name.txt old name 2.txt,new name 2.txt...'` | Select only files that are Renamed and list their old and new names (R) |
|
||||||
| added\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Added (A) |
|
| added\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Added (A) |
|
||||||
| copied\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Copied (C) |
|
| copied\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Copied (C) |
|
||||||
| deleted\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Deleted (D) |
|
| deleted\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Deleted (D) |
|
||||||
| modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Modified (M) |
|
| modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Modified (M) |
|
||||||
| renamed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Renamed (R) |
|
| renamed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Renamed (R) |
|
||||||
| all\_old\_new\_renamed\_files | `string` | `'old name.txt,new name.txt old name 2.txt,new name 2.txt...'` | Select only files that are Renamed and list their old and new names (R) |
|
|
||||||
| type\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that have their file type changed (T) |
|
| type\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that have their file type changed (T) |
|
||||||
| unmerged\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unmerged (U) |
|
| unmerged\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unmerged (U) |
|
||||||
| unknown\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unknown (X) |
|
| unknown\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unknown (X) |
|
||||||
@@ -130,6 +129,7 @@ Support this project with a :star:
|
|||||||
|:---------------------------------:|:----------------------:|:--------:|:---------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:---------------------------------:|:----------------------:|:--------:|:---------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
| token | `string` | `false` | `${{ github.token }}` | [GITHUB\_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
|
| token | `string` | `false` | `${{ github.token }}` | [GITHUB\_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
|
||||||
| separator | `string` | `false` | `' '` | Split character for output strings |
|
| separator | `string` | `false` | `' '` | Split character for output strings |
|
||||||
|
| include\_all\_old\_new\_renamed\_files | `boolean` | `false` | `false` | Include `all_old_new_renamed_files` output. Note this can generate a large debug output See: [#501](https://github.com/tj-actions/changed-files/issues/501). |
|
||||||
| old\_new\_separator | `string` | `false` | `','` | Split character for old and new filename pairs |
|
| old\_new\_separator | `string` | `false` | `','` | Split character for old and new filename pairs |
|
||||||
| old\_new\_files\_separator | `string` | `false` | `' '` | Split character for multiple old and new filename pairs |
|
| old\_new\_files\_separator | `string` | `false` | `' '` | Split character for multiple old and new filename pairs |
|
||||||
| files | `string` OR `string[]` | `false` | | Check for changes <br> using only these <br> list of file(s) <br> (Defaults to the <br> entire repo) |
|
| files | `string` OR `string[]` | `false` | | Check for changes <br> using only these <br> list of file(s) <br> (Defaults to the <br> entire repo) |
|
||||||
@@ -141,9 +141,9 @@ Support this project with a :star:
|
|||||||
| sha | `string` | `true` | `${{ github.sha }}` | Specify a different <br> commit SHA <br> used for <br> comparing changes |
|
| sha | `string` | `true` | `${{ github.sha }}` | Specify a different <br> commit SHA <br> used for <br> comparing changes |
|
||||||
| base\_sha | `string` | `false` | | Specify a different <br> base commit SHA <br> used for <br> comparing changes |
|
| base\_sha | `string` | `false` | | Specify a different <br> base commit SHA <br> used for <br> comparing changes |
|
||||||
| path | `string` | `false` | | Relative path under <br> `GITHUB_WORKSPACE` <br> to the repository |
|
| path | `string` | `false` | | Relative path under <br> `GITHUB_WORKSPACE` <br> to the repository |
|
||||||
| since\_last\_remote\_commit | `string` | `false` | `false` | Use the last commit on the remote <br> branch as the `base_sha` <br> (Defaults to the last commit <br> on the target branch for Pull requests <br> or the previous commit <br> on the current branch <br> for push events). <br /> NOTE: This requires <br /> `fetch-depth: 0` <br /> with `actions/checkout@v2` |
|
| since\_last\_remote\_commit | `boolean` | `false` | `false` | Use the last commit on the remote <br> branch as the `base_sha` <br> (Defaults to the last commit <br> on the target branch for Pull requests <br> or the previous commit <br> on the current branch <br> for push events). <br /> NOTE: This requires <br /> `fetch-depth: 0` <br /> with `actions/checkout@v2` |
|
||||||
| use\_fork\_point | `string` | `false` | `false` | Finds best common ancestor <br /> between two commits <br /> to use in a three-way merge <br /> as the `base_sha` <br /> See: [git merge-base](https://git-scm.com/docs/git-merge-base#Documentation/git-merge-base.txt---fork-point). <br> NOTE: This pulls the entire commit history of the base branch |
|
| use\_fork\_point | `boolean` | `false` | `false` | Finds best common ancestor <br /> between two commits <br /> to use in a three-way merge <br /> as the `base_sha` <br /> See: [git merge-base](https://git-scm.com/docs/git-merge-base#Documentation/git-merge-base.txt---fork-point). <br> NOTE: This pulls the entire commit history of the base branch |
|
||||||
| quotepath | `string` | `false` | `true` | Output filenames completely verbatim by setting this to `false` |
|
| quotepath | `boolean` | `false` | `true` | Output filenames completely verbatim by setting this to `false` |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -157,11 +157,11 @@ Support this project with a :star:
|
|||||||
|
|
||||||
- name: Get changed files using defaults
|
- name: Get changed files using defaults
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
|
|
||||||
- name: Get changed files using a comma separator
|
- name: Get changed files using a comma separator
|
||||||
id: changed-files-comma
|
id: changed-files-comma
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
separator: ","
|
separator: ","
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ Support this project with a :star:
|
|||||||
|
|
||||||
- name: Get specific changed files
|
- name: Get specific changed files
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
my-file.txt
|
my-file.txt
|
||||||
@@ -224,14 +224,14 @@ Support this project with a :star:
|
|||||||
|
|
||||||
- name: Use a source file or list of file(s) to populate to files input.
|
- name: Use a source file or list of file(s) to populate to files input.
|
||||||
id: changed-files-specific-source-file
|
id: changed-files-specific-source-file
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
files_from_source_file: |
|
files_from_source_file: |
|
||||||
test/changed-files-list.txt
|
test/changed-files-list.txt
|
||||||
|
|
||||||
- name: Use a source file or list of file(s) to populate to files input and optionally specify more files.
|
- name: Use a source file or list of file(s) to populate to files input and optionally specify more files.
|
||||||
id: changed-files-specific-source-file-and-specify-files
|
id: changed-files-specific-source-file-and-specify-files
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
files_from_source_file: |
|
files_from_source_file: |
|
||||||
test/changed-files-list.txt
|
test/changed-files-list.txt
|
||||||
@@ -240,13 +240,13 @@ Support this project with a :star:
|
|||||||
|
|
||||||
- name: Use a different commit SHA
|
- name: Use a different commit SHA
|
||||||
id: changed-files-custom-sha
|
id: changed-files-custom-sha
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.event.pull_request.head.sha }}
|
sha: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: Use a different base SHA
|
- name: Use a different base SHA
|
||||||
id: changed-files-custom-base-sha
|
id: changed-files-custom-base-sha
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
base_sha: "2096ed0"
|
base_sha: "2096ed0"
|
||||||
|
|
||||||
@@ -258,7 +258,7 @@ Support this project with a :star:
|
|||||||
|
|
||||||
- name: Run changed-files with defaults on the dir1
|
- name: Run changed-files with defaults on the dir1
|
||||||
id: changed-files-for-dir1
|
id: changed-files-for-dir1
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
path: dir1
|
path: dir1
|
||||||
|
|
||||||
@@ -270,19 +270,19 @@ Support this project with a :star:
|
|||||||
|
|
||||||
- name: Run changed-files using the last commit on the remote branch
|
- name: Run changed-files using the last commit on the remote branch
|
||||||
id: changed-files-since-last-remote-commit
|
id: changed-files-since-last-remote-commit
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
since_last_remote_commit: "true"
|
since_last_remote_commit: "true"
|
||||||
|
|
||||||
- name: Run changed-files using the fork point of a pull request
|
- name: Run changed-files using the fork point of a pull request
|
||||||
id: changed-files-fork-point
|
id: changed-files-fork-point
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
use_fork_point: "true"
|
use_fork_point: "true"
|
||||||
|
|
||||||
- name: Run changed-files with quotepath disabled
|
- name: Run changed-files with quotepath disabled
|
||||||
id: changed-files-quotepath
|
id: changed-files-quotepath
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
quotepath: "false"
|
quotepath: "false"
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ With the switch from using grep's Extended regex to match files to the natively
|
|||||||
|
|
||||||
- name: Get specific changed files
|
- name: Get specific changed files
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: tj-actions/changed-files@v19.3
|
uses: tj-actions/changed-files@v20.2
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
*.sh
|
*.sh
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ inputs:
|
|||||||
description: 'Split character for output strings'
|
description: 'Split character for output strings'
|
||||||
required: false
|
required: false
|
||||||
default: " "
|
default: " "
|
||||||
|
include_all_old_new_renamed_files:
|
||||||
|
description: 'Include all_old_new_renamed_files output. Note this can generate a large debug output See: #501.'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
old_new_separator:
|
old_new_separator:
|
||||||
description: 'Split character for old and new filename pairs'
|
description: 'Split character for old and new filename pairs'
|
||||||
required: false
|
required: false
|
||||||
@@ -193,6 +197,7 @@ runs:
|
|||||||
INPUT_TARGET_BRANCH: ${{ steps.changed-files-diff-sha.outputs.target_branch }}
|
INPUT_TARGET_BRANCH: ${{ steps.changed-files-diff-sha.outputs.target_branch }}
|
||||||
INPUT_CURRENT_BRANCH: ${{ steps.changed-files-diff-sha.outputs.current_branch }}
|
INPUT_CURRENT_BRANCH: ${{ steps.changed-files-diff-sha.outputs.current_branch }}
|
||||||
INPUT_QUOTEPATH: ${{ inputs.quotepath }}
|
INPUT_QUOTEPATH: ${{ inputs.quotepath }}
|
||||||
|
INPUT_INCLUDE_ALL_OLD_NEW_RENAMED_FILES: ${{ inputs.include_all_old_new_renamed_files }}
|
||||||
INPUT_OLD_NEW_SEPARATOR: ${{ inputs.old_new_separator }}
|
INPUT_OLD_NEW_SEPARATOR: ${{ inputs.old_new_separator }}
|
||||||
INPUT_OLD_NEW_FILES_SEPARATOR: ${{ inputs.old_new_files_separator }}
|
INPUT_OLD_NEW_FILES_SEPARATOR: ${{ inputs.old_new_files_separator }}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ function get_renames() {
|
|||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
done < <(git submodule | awk '{print $2}')
|
done < <(git submodule | awk '{print $2}')
|
||||||
|
|
||||||
git log --name-status --ignore-submodules=all "$base".."$sha" | grep -E "^R" | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}'
|
git log --name-status --ignore-submodules=all "$base".."$sha" | grep -E "^R" | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +79,9 @@ if [[ -z "$INPUT_FILES_PATTERN_FILE" ]]; then
|
|||||||
ALL_CHANGED_AND_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "*ACDMRTUX" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_CHANGED_AND_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "*ACDMRTUX" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMRD" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMRD" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_OLD_NEW_RENAMED_FILES=$(get_renames "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" | awk -v d="$INPUT_OLD_NEW_FILES_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
if [[ $INPUT_INCLUDE_ALL_OLD_NEW_RENAMED_FILES == "true" ]]; then
|
||||||
|
ALL_OLD_NEW_RENAMED_FILES=$(get_renames "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" | awk -v d="$INPUT_OLD_NEW_FILES_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
ADDED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" A | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ADDED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" A | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
COPIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" C | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
COPIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" C | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
@@ -91,7 +94,9 @@ else
|
|||||||
ALL_CHANGED_AND_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "*ACDMRTUX" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_CHANGED_AND_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "*ACDMRTUX" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMRD" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMRD" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_OLD_NEW_RENAMED_FILES=$(get_renames "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="$INPUT_OLD_NEW_FILES_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
if [[ $INPUT_INCLUDE_ALL_OLD_NEW_RENAMED_FILES == "true" ]]; then
|
||||||
|
ALL_OLD_NEW_RENAMED_FILES=$(get_renames "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" | grep -w -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="$INPUT_OLD_NEW_FILES_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
|
fi
|
||||||
|
|
||||||
ALL_OTHER_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_OTHER_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
UNIQUE_ALL_CHANGED=$(echo "${ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk '!a[$0]++' | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
UNIQUE_ALL_CHANGED=$(echo "${ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk '!a[$0]++' | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
@@ -207,7 +212,9 @@ echo "Unknown files: $UNKNOWN"
|
|||||||
echo "All changed and modified files: $ALL_CHANGED_AND_MODIFIED"
|
echo "All changed and modified files: $ALL_CHANGED_AND_MODIFIED"
|
||||||
echo "All changed files: $ALL_CHANGED"
|
echo "All changed files: $ALL_CHANGED"
|
||||||
echo "All modified files: $ALL_MODIFIED"
|
echo "All modified files: $ALL_MODIFIED"
|
||||||
echo "All old & new renamed files: $ALL_OLD_NEW_RENAMED_FILES"
|
if [[ $INPUT_INCLUDE_ALL_OLD_NEW_RENAMED_FILES == "true" ]]; then
|
||||||
|
echo "All old & new renamed files: $ALL_OLD_NEW_RENAMED_FILES"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::set-output name=added_files::$ADDED"
|
echo "::set-output name=added_files::$ADDED"
|
||||||
echo "::set-output name=copied_files::$COPIED"
|
echo "::set-output name=copied_files::$COPIED"
|
||||||
@@ -220,6 +227,8 @@ echo "::set-output name=unknown_files::$UNKNOWN"
|
|||||||
echo "::set-output name=all_changed_and_modified_files::$ALL_CHANGED_AND_MODIFIED"
|
echo "::set-output name=all_changed_and_modified_files::$ALL_CHANGED_AND_MODIFIED"
|
||||||
echo "::set-output name=all_changed_files::$ALL_CHANGED"
|
echo "::set-output name=all_changed_files::$ALL_CHANGED"
|
||||||
echo "::set-output name=all_modified_files::$ALL_MODIFIED"
|
echo "::set-output name=all_modified_files::$ALL_MODIFIED"
|
||||||
echo "::set-output name=all_old_new_renamed_files::$ALL_OLD_NEW_RENAMED_FILES"
|
if [[ $INPUT_INCLUDE_ALL_OLD_NEW_RENAMED_FILES == "true" ]]; then
|
||||||
|
echo "::set-output name=all_old_new_renamed_files::$ALL_OLD_NEW_RENAMED_FILES"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|||||||
Reference in New Issue
Block a user