Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f917cc3459 | ||
|
|
c204bb533c | ||
|
|
3f66a14524 | ||
|
|
b7e12d640e | ||
|
|
c1d40aa45b | ||
|
|
4e8540cc23 | ||
|
|
9b119a28a5 | ||
|
|
ff749ea95a | ||
|
|
775240461c | ||
|
|
642651fe29 | ||
|
|
c029ed4f59 | ||
|
|
2f20ef2c6b | ||
|
|
686b672b03 | ||
|
|
59233a5db9 | ||
|
|
00f80efd45 | ||
|
|
000d3cff5a | ||
|
|
c1644a1f17 | ||
|
|
af9f912974 | ||
|
|
f56e736bed | ||
|
|
0d89cb5d73 | ||
|
|
ef4467c8b8 | ||
|
|
16f1061f41 | ||
|
|
ee22dfaf73 | ||
|
|
38982dbe41 | ||
|
|
064d858f63 | ||
|
|
31bc57ef04 |
2
.github/workflows/sync-release-version.yml
vendored
2
.github/workflows/sync-release-version.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
paths: |
|
paths: |
|
||||||
README.md
|
README.md
|
||||||
- name: Generate CHANGELOG
|
- name: Generate CHANGELOG
|
||||||
uses: tj-actions/github-changelog-generator@v1.8
|
uses: tj-actions/github-changelog-generator@v1.11
|
||||||
with:
|
with:
|
||||||
output: 'HISTORY.md'
|
output: 'HISTORY.md'
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
|
|||||||
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
- name: Checkout to branch
|
- name: Checkout to branch
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: shellcheck
|
- name: shellcheck
|
||||||
uses: reviewdog/action-shellcheck@v1.12
|
uses: reviewdog/action-shellcheck@v1.13
|
||||||
|
|
||||||
test-multiple-repositories:
|
test-multiple-repositories:
|
||||||
name: Test with multiple repositories
|
name: Test with multiple repositories
|
||||||
@@ -342,7 +342,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
.github/workflows/test.yml
|
**/test.yml
|
||||||
action.yml
|
action.yml
|
||||||
separator: "|"
|
separator: "|"
|
||||||
- name: Show output
|
- name: Show output
|
||||||
@@ -425,7 +425,7 @@ jobs:
|
|||||||
test/changed-files-list.txt
|
test/changed-files-list.txt
|
||||||
test/changed-files-list.txt
|
test/changed-files-list.txt
|
||||||
files: |
|
files: |
|
||||||
.github/workflows/rebase.yml
|
**/workflows/rebase.yml
|
||||||
- name: Verify any_changed from source files
|
- name: Verify any_changed from source files
|
||||||
if: |
|
if: |
|
||||||
(
|
(
|
||||||
@@ -555,7 +555,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
.github/workflows/test.yml
|
.github/**/test.yml
|
||||||
- name: Verify only_changed files
|
- name: Verify only_changed files
|
||||||
if: steps.changed-files-specific-only-changed.outputs.other_changed_files != ''
|
if: steps.changed-files-specific-only-changed.outputs.other_changed_files != ''
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/update-readme.yml
vendored
2
.github/workflows/update-readme.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run test
|
- name: Run test
|
||||||
uses: tj-actions/remark@v1.7
|
uses: tj-actions/remark@v2.3
|
||||||
|
|
||||||
- name: Verify Changed files
|
- name: Verify Changed files
|
||||||
uses: tj-actions/verify-changed-files@v8
|
uses: tj-actions/verify-changed-files@v8
|
||||||
|
|||||||
88
HISTORY.md
88
HISTORY.md
@@ -1,16 +1,77 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [v12](https://github.com/tj-actions/changed-files/tree/v12) (2021-12-14)
|
## [v13](https://github.com/tj-actions/changed-files/tree/v13) (2022-01-05)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.1.4...v12)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.0.1...v13)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- \[Feature\] Make it easier to exclude files [\#265](https://github.com/tj-actions/changed-files/issues/265)
|
||||||
|
- \[Feature\] Support the same filter syntax as GitHub Workflows [\#264](https://github.com/tj-actions/changed-files/issues/264)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- Upgraded to v1.1.4 [\#286](https://github.com/tj-actions/changed-files/pull/286) ([jackton1](https://github.com/jackton1))
|
- Upgraded tj-actions/glob to v3.2 [\#306](https://github.com/tj-actions/changed-files/pull/306) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Update tj-actions/remark action to v2.3 [\#305](https://github.com/tj-actions/changed-files/pull/305) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Add support for using github's glob pattern syntax [\#304](https://github.com/tj-actions/changed-files/pull/304) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Update tj-actions/remark action to v2 [\#302](https://github.com/tj-actions/changed-files/pull/302) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Bump tj-actions/github-changelog-generator from 1.10 to 1.11 [\#300](https://github.com/tj-actions/changed-files/pull/300) ([dependabot[bot]](https://github.com/apps/dependabot))
|
||||||
|
- Update tj-actions/github-changelog-generator action to v1.10 [\#299](https://github.com/tj-actions/changed-files/pull/299) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Upgraded to v2.0.1 [\#298](https://github.com/tj-actions/changed-files/pull/298) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v12.2 [\#297](https://github.com/tj-actions/changed-files/pull/297) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v1.1.4](https://github.com/tj-actions/changed-files/tree/v1.1.4) (2021-12-14)
|
## [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/v11.9...v1.1.4)
|
[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:**
|
||||||
|
|
||||||
|
- Fixed unbound variable warnings [\#296](https://github.com/tj-actions/changed-files/pull/296) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v12.1 [\#295](https://github.com/tj-actions/changed-files/pull/295) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v12.1](https://github.com/tj-actions/changed-files/tree/v12.1) (2021-12-30)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.0.0...v12.1)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- \[BUG\] The `other_modified_files` contains all modified files even those that match the file `filter`. [\#293](https://github.com/tj-actions/changed-files/issues/293)
|
||||||
|
- \[BUG\] The `only_modified` is evaluated to `true` even when `other_modified_files` is not empty. [\#292](https://github.com/tj-actions/changed-files/issues/292)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fixed regression bug with other\_modified and other\_changed outputs [\#294](https://github.com/tj-actions/changed-files/pull/294) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Update reviewdog/action-shellcheck action to v1.13 [\#291](https://github.com/tj-actions/changed-files/pull/291) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Upgraded to v2.0.0 [\#290](https://github.com/tj-actions/changed-files/pull/290) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Updated README.md [\#289](https://github.com/tj-actions/changed-files/pull/289) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v2.0.0](https://github.com/tj-actions/changed-files/tree/v2.0.0) (2021-12-17)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12...v2.0.0)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- \[BUG\] Files input doesn't work when running with `act` [\#251](https://github.com/tj-actions/changed-files/issues/251)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- Breaking changes in patch updates? [\#288](https://github.com/tj-actions/changed-files/issues/288)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Upgraded to v12 [\#287](https://github.com/tj-actions/changed-files/pull/287) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v12](https://github.com/tj-actions/changed-files/tree/v12) (2021-12-14)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.9...v12)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -20,12 +81,9 @@
|
|||||||
|
|
||||||
- \[BUG\] Failed to get change files on pull\_request merge event [\#281](https://github.com/tj-actions/changed-files/issues/281)
|
- \[BUG\] Failed to get change files on pull\_request merge event [\#281](https://github.com/tj-actions/changed-files/issues/281)
|
||||||
|
|
||||||
**Closed issues:**
|
|
||||||
|
|
||||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Upgraded to v1.1.4 [\#286](https://github.com/tj-actions/changed-files/pull/286) ([jackton1](https://github.com/jackton1))
|
||||||
- \[PR 2\]: Added support for listing all\_modified\_files. [\#285](https://github.com/tj-actions/changed-files/pull/285) ([jackton1](https://github.com/jackton1))
|
- \[PR 2\]: Added support for listing all\_modified\_files. [\#285](https://github.com/tj-actions/changed-files/pull/285) ([jackton1](https://github.com/jackton1))
|
||||||
- Update peter-evans/create-pull-request action to v3.12.0 [\#284](https://github.com/tj-actions/changed-files/pull/284) ([renovate[bot]](https://github.com/apps/renovate))
|
- Update peter-evans/create-pull-request action to v3.12.0 [\#284](https://github.com/tj-actions/changed-files/pull/284) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
- \[PR 1\]: Renamed all\_modified\_files to all\_changed\_files [\#283](https://github.com/tj-actions/changed-files/pull/283) ([jackton1](https://github.com/jackton1))
|
- \[PR 1\]: Renamed all\_modified\_files to all\_changed\_files [\#283](https://github.com/tj-actions/changed-files/pull/283) ([jackton1](https://github.com/jackton1))
|
||||||
@@ -555,7 +613,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:**
|
||||||
|
|
||||||
@@ -571,13 +629,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:**
|
||||||
|
|
||||||
|
|||||||
75
README.md
75
README.md
@@ -31,17 +31,7 @@ Retrieve all changed files relative to the default branch (`pull_request*` based
|
|||||||
* 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.
|
||||||
* [Regex pattern](https://www.gnu.org/software/grep/manual/grep.html#Regular-Expressions) matching on a subset of files.
|
* [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching on a subset of files.
|
||||||
|
|
||||||
|
|
||||||
> NOTE: :warning:
|
|
||||||
> * All users referencing the legacy `v1.x.x` version, are required to switch to `v*` or `v*.*` versioning semantic.
|
|
||||||
> * A breaking change was introduced in `v1.x.x` legacy version, which is no longer supported and future updates would only be made to `v*` or `v*.*`.
|
|
||||||
|
|
||||||
| Legacy version | Recommended version |
|
|
||||||
|---------------------|-----------------------|
|
|
||||||
| `v1.x.x` | `v12` |
|
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -73,7 +63,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v12
|
uses: tj-actions/changed-files@v13
|
||||||
|
|
||||||
- name: List all changed files
|
- name: List all changed files
|
||||||
run: |
|
run: |
|
||||||
@@ -150,11 +140,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@v12
|
uses: tj-actions/changed-files@v13
|
||||||
|
|
||||||
- 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@v12
|
uses: tj-actions/changed-files@v13
|
||||||
with:
|
with:
|
||||||
separator: ","
|
separator: ","
|
||||||
|
|
||||||
@@ -165,36 +155,37 @@ Support this project with a :star:
|
|||||||
done
|
done
|
||||||
|
|
||||||
- name: Run step when a file changes
|
- name: Run step when a file changes
|
||||||
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
|
if: contains(steps.changed-files.outputs.modified_files, "my-file.txt")
|
||||||
run: |
|
run: |
|
||||||
echo "Your my-file.txt file has been modified."
|
echo "Your my-file.txt file has been modified."
|
||||||
|
|
||||||
- name: Run step when a file has been deleted
|
- name: Run step when a file has been deleted
|
||||||
if: contains(steps.changed-files.outputs.deleted_files, 'test.txt')
|
if: contains(steps.changed-files.outputs.deleted_files, "test.txt")
|
||||||
run: |
|
run: |
|
||||||
echo "Your test.txt file has been deleted."
|
echo "Your test.txt file has been deleted."
|
||||||
|
|
||||||
- name: Get specific changed files
|
- name: Get specific changed files
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: tj-actions/changed-files@v12
|
uses: tj-actions/changed-files@v13
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
my-file.txt
|
my-file.txt
|
||||||
test.txt
|
test.txt
|
||||||
new.txt
|
new.txt
|
||||||
test_directory
|
test_directory
|
||||||
\.sh$
|
*.sh
|
||||||
.(png|jpeg)$
|
*.png
|
||||||
.(sql|py)$
|
!*.md
|
||||||
^(mynewfile|custom)
|
*.jpeg
|
||||||
|
**/migrate-*.sql
|
||||||
|
|
||||||
- name: Run step if any of the listed files above change
|
- name: Run step if any of the listed files above change
|
||||||
if: steps.changed-files-specific.outputs.any_changed == 'true'
|
if: steps.changed-files-specific.outputs.any_changed == "true"
|
||||||
run: |
|
run: |
|
||||||
echo "One or more files listed above has changed."
|
echo "One or more files listed above has changed."
|
||||||
|
|
||||||
- name: Run step if only the files listed above change
|
- name: Run step if only the files listed above change
|
||||||
if: steps.changed-files-specific.outputs.only_changed == 'true'
|
if: steps.changed-files-specific.outputs.only_changed == "true"
|
||||||
run: |
|
run: |
|
||||||
echo "Only files listed above have changed."
|
echo "Only files listed above have changed."
|
||||||
|
|
||||||
@@ -214,14 +205,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@v12
|
uses: tj-actions/changed-files@v13
|
||||||
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@v12
|
uses: tj-actions/changed-files@v13
|
||||||
with:
|
with:
|
||||||
files_from_source_file: |
|
files_from_source_file: |
|
||||||
test/changed-files-list.txt
|
test/changed-files-list.txt
|
||||||
@@ -230,13 +221,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@v12
|
uses: tj-actions/changed-files@v13
|
||||||
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@v12
|
uses: tj-actions/changed-files@v13
|
||||||
with:
|
with:
|
||||||
base_sha: "2096ed0"
|
base_sha: "2096ed0"
|
||||||
|
|
||||||
@@ -248,7 +239,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@v12
|
uses: tj-actions/changed-files@v13
|
||||||
with:
|
with:
|
||||||
path: dir1
|
path: dir1
|
||||||
|
|
||||||
@@ -260,32 +251,12 @@ 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@v12
|
uses: tj-actions/changed-files@v13
|
||||||
with:
|
with:
|
||||||
since_last_remote_commit: 'true'
|
since_last_remote_commit: "true"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Running [pre-commit](https://pre-commit.com/) on all modified files
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
...
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v12
|
|
||||||
|
|
||||||
- name: Pre-commit
|
|
||||||
uses: pre-commit/action@v2.0.0
|
|
||||||
with:
|
|
||||||
extra_args: -v --hook-stage push --files ${{ steps.changed-files.outputs.all_changed_files }}
|
|
||||||
token: ${{ secrets.github_token }}
|
|
||||||
```
|
|
||||||
|
|
||||||
<img width="1147" alt="Screen Shot 2021-11-19 at 4 59 21 PM" src="https://user-images.githubusercontent.com/17484350/142696936-8b7ca955-7ef9-4d53-9bdf-3e0008e90c3f.png">
|
<img width="1147" alt="Screen Shot 2021-11-19 at 4 59 21 PM" src="https://user-images.githubusercontent.com/17484350/142696936-8b7ca955-7ef9-4d53-9bdf-3e0008e90c3f.png">
|
||||||
|
|
||||||
* Free software: [MIT license](LICENSE)
|
* Free software: [MIT license](LICENSE)
|
||||||
@@ -340,7 +311,3 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|||||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||||
|
|
||||||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
||||||
|
|
||||||
[buymeacoffee]: https://www.buymeacoffee.com/jackton1
|
|
||||||
|
|
||||||
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
|
|
||||||
|
|||||||
11
action.yml
11
action.yml
@@ -104,8 +104,17 @@ runs:
|
|||||||
id: source-input-files
|
id: source-input-files
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
||||||
|
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
|
||||||
INPUT_FILES: ${{ inputs.files }}
|
INPUT_FILES: ${{ inputs.files }}
|
||||||
INPUT_FILES_FROM_SOURCE_FILE: ${{ inputs.files_from_source_file }}
|
INPUT_FILES_FROM_SOURCE_FILE: ${{ inputs.files_from_source_file }}
|
||||||
|
- name: Glob match
|
||||||
|
uses: tj-actions/glob@v3.2
|
||||||
|
id: glob
|
||||||
|
with:
|
||||||
|
files: ${{ steps.source-input-files.outputs.files }}
|
||||||
|
files-separator: " "
|
||||||
|
separator: "|"
|
||||||
- run: |
|
- run: |
|
||||||
# "Set base sha..."
|
# "Set base sha..."
|
||||||
if [[ -n "${{ inputs.base_sha }}" ]]; then
|
if [[ -n "${{ inputs.base_sha }}" ]]; then
|
||||||
@@ -132,7 +141,7 @@ runs:
|
|||||||
INPUT_SHA: ${{ inputs.sha }}
|
INPUT_SHA: ${{ inputs.sha }}
|
||||||
INPUT_BASE_SHA: ${{ steps.base-sha.outputs.base_sha }}
|
INPUT_BASE_SHA: ${{ steps.base-sha.outputs.base_sha }}
|
||||||
INPUT_TOKEN: ${{ inputs.token }}
|
INPUT_TOKEN: ${{ inputs.token }}
|
||||||
INPUT_FILES: ${{ steps.source-input-files.outputs.files }}
|
INPUT_FILES: ${{ steps.glob.outputs.paths }}
|
||||||
INPUT_SEPARATOR: ${{ inputs.separator }}
|
INPUT_SEPARATOR: ${{ inputs.separator }}
|
||||||
INPUT_PATH: ${{ inputs.path }}
|
INPUT_PATH: ${{ inputs.path }}
|
||||||
|
|
||||||
|
|||||||
@@ -126,8 +126,6 @@ else
|
|||||||
ALL_OTHER_CHANGED=$(git diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_OTHER_CHANGED=$(git diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
UNIQUE_ALL_CHANGED=$(echo "${ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
UNIQUE_ALL_CHANGED=$(echo "${ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
|
|
||||||
UNIQUE_ALL_CHANGED=$(echo "${UNIQUE_ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
||||||
|
|
||||||
if [[ -n "${UNIQUE_ALL_CHANGED}" ]]; then
|
if [[ -n "${UNIQUE_ALL_CHANGED}" ]]; then
|
||||||
echo "Matching changed files: ${UNIQUE_ALL_CHANGED}"
|
echo "Matching changed files: ${UNIQUE_ALL_CHANGED}"
|
||||||
echo "::set-output name=any_changed::true"
|
echo "::set-output name=any_changed::true"
|
||||||
@@ -135,6 +133,8 @@ else
|
|||||||
echo "::set-output name=any_changed::false"
|
echo "::set-output name=any_changed::false"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
OTHER_CHANGED=""
|
||||||
|
|
||||||
if [[ -n $ALL_OTHER_CHANGED ]]; then
|
if [[ -n $ALL_OTHER_CHANGED ]]; then
|
||||||
if [[ -n "$UNIQUE_ALL_CHANGED" ]]; then
|
if [[ -n "$UNIQUE_ALL_CHANGED" ]]; then
|
||||||
OTHER_CHANGED=$(echo "${ALL_OTHER_CHANGED}|${UNIQUE_ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort | uniq -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
OTHER_CHANGED=$(echo "${ALL_OTHER_CHANGED}|${UNIQUE_ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort | uniq -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
@@ -156,8 +156,6 @@ else
|
|||||||
ALL_OTHER_MODIFIED=$(git diff --diff-filter="ACMRD" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_OTHER_MODIFIED=$(git diff --diff-filter="ACMRD" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
UNIQUE_ALL_MODIFIED=$(echo "${ALL_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
UNIQUE_ALL_MODIFIED=$(echo "${ALL_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
|
|
||||||
UNIQUE_ALL_MODIFIED=$(echo "${UNIQUE_ALL_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
||||||
|
|
||||||
if [[ -n "${UNIQUE_ALL_MODIFIED}" ]]; then
|
if [[ -n "${UNIQUE_ALL_MODIFIED}" ]]; then
|
||||||
echo "Matching modified files: ${UNIQUE_ALL_MODIFIED}"
|
echo "Matching modified files: ${UNIQUE_ALL_MODIFIED}"
|
||||||
echo "::set-output name=any_modified::true"
|
echo "::set-output name=any_modified::true"
|
||||||
@@ -165,6 +163,8 @@ else
|
|||||||
echo "::set-output name=any_modified::false"
|
echo "::set-output name=any_modified::false"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
OTHER_MODIFIED=""
|
||||||
|
|
||||||
if [[ -n $ALL_OTHER_MODIFIED ]]; then
|
if [[ -n $ALL_OTHER_MODIFIED ]]; then
|
||||||
if [[ -n "$UNIQUE_ALL_MODIFIED" ]]; then
|
if [[ -n "$UNIQUE_ALL_MODIFIED" ]]; then
|
||||||
OTHER_MODIFIED=$(echo "${ALL_OTHER_MODIFIED}|${UNIQUE_ALL_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort | uniq -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
OTHER_MODIFIED=$(echo "${ALL_OTHER_MODIFIED}|${UNIQUE_ALL_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort | uniq -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
@@ -193,9 +193,11 @@ else
|
|||||||
echo "::set-output name=any_deleted::false"
|
echo "::set-output name=any_deleted::false"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
OTHER_DELETED=""
|
||||||
|
|
||||||
if [[ -n $ALL_OTHER_DELETED ]]; then
|
if [[ -n $ALL_OTHER_DELETED ]]; then
|
||||||
if [[ -n "$UNIQUE_ALL_DELETED" ]]; then
|
if [[ -n "$UNIQUE_ALL_DELETED" ]]; then
|
||||||
OTHER_DELETED=$(echo "${ALL_OTHER_DELETED}|${UNIQUE_ALL_DELETED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort | uniq -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
OTHER_DELETED=$(echo "${ALL_OTHER_DELETED}|${UNIQUE_ALL_DELETED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort | uniq -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
else
|
else
|
||||||
OTHER_DELETED=$ALL_OTHER_DELETED
|
OTHER_DELETED=$ALL_OTHER_DELETED
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -4,22 +4,26 @@ set -e
|
|||||||
|
|
||||||
echo "::group::changed-files-from-source-file"
|
echo "::group::changed-files-from-source-file"
|
||||||
|
|
||||||
IFS=" " read -r -a FILES <<< "$(echo "${INPUT_FILES[@]}" | sort -u | tr "\n" " ")"
|
RAW_FILES=()
|
||||||
|
|
||||||
if [[ -n $INPUT_FILES_FROM_SOURCE_FILE ]]; then
|
if [[ -n $INPUT_FILES_FROM_SOURCE_FILE ]]; then
|
||||||
for file in $INPUT_FILES_FROM_SOURCE_FILE
|
for file in $INPUT_FILES_FROM_SOURCE_FILE
|
||||||
do
|
do
|
||||||
while read -r fileName; do
|
while read -r fileName; do
|
||||||
FILES+=("$fileName")
|
RAW_FILES+=("$fileName")
|
||||||
done <"$file"
|
done <"$file"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Input Files: ${FILES[*]}"
|
IFS=" " read -r -a CLEAN_FILES <<< "$(echo "${RAW_FILES[*]}" | tr "\r\n" "\n" | tr " " "\n" | sort -u | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}')"
|
||||||
|
|
||||||
IFS=" " read -r -a ALL_UNIQUE_FILES <<< "$(echo "${FILES[@]}" | tr " " "\n" | sort -u | tr "\n" " ")"
|
IFS=" " read -r -a CLEAN_INPUT_FILES <<< "$(echo "${INPUT_FILES}" | tr "\r\n" "\n" | tr " " "\n" | sort -u | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}')"
|
||||||
|
|
||||||
echo "All Unique Input files: ${ALL_UNIQUE_FILES[*]}"
|
FILES=("${CLEAN_FILES[@]}" "${CLEAN_INPUT_FILES[@]}")
|
||||||
|
|
||||||
|
IFS=" " read -r -a ALL_UNIQUE_FILES <<< "$(echo "${FILES[@]}" | tr "\r\n" "\n" | tr " " "\n" | sort -u | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}')"
|
||||||
|
|
||||||
|
echo "Input files: ${ALL_UNIQUE_FILES[*]}"
|
||||||
|
|
||||||
echo "::set-output name=files::${ALL_UNIQUE_FILES[*]}"
|
echo "::set-output name=files::${ALL_UNIQUE_FILES[*]}"
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@
|
|||||||
action.yml
|
action.yml
|
||||||
action.yml
|
action.yml
|
||||||
action.yml
|
action.yml
|
||||||
|
!*.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user