Compare commits

...

12 Commits

Author SHA1 Message Date
Tonye Jack
00f80efd45 Fixed unbound variable warnings (#296) 2021-12-29 21:22:46 -05:00
Tonye Jack
000d3cff5a Update README.md 2021-12-29 20:45:48 -05:00
Tonye Jack
c1644a1f17 Update README.md 2021-12-29 20:44:54 -05:00
Tonye Jack
af9f912974 Upgraded to v12.1 (#295)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2021-12-29 20:01:32 -05:00
Tonye Jack
f56e736bed Fixed regression bug with other_modified and other_changed outputs (#294) 2021-12-29 19:57:35 -05:00
Renovate Bot
0d89cb5d73 Update reviewdog/action-shellcheck action to v1.13 2021-12-28 05:11:23 -05:00
Tonye Jack
ef4467c8b8 Update README.md 2021-12-24 12:33:11 -05:00
Tonye Jack
16f1061f41 Update README.md 2021-12-20 02:41:41 -05:00
Tonye Jack
ee22dfaf73 Update README.md 2021-12-20 02:40:27 -05:00
Tonye Jack
38982dbe41 Update README.md 2021-12-17 20:12:28 -05:00
Tonye Jack
064d858f63 Updated README.md (#289)
* Updated README.md

* Update README.md

Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2021-12-17 15:36:30 -05:00
Tonye Jack
31bc57ef04 Upgraded from v12 -> v2.0.0 (#290)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2021-12-17 15:13:40 -05:00
4 changed files with 64 additions and 51 deletions

View File

@@ -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

View File

@@ -1,16 +1,44 @@
# Changelog # Changelog
## [v12](https://github.com/tj-actions/changed-files/tree/v12) (2021-12-14) ## [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/v1.1.4...v12) [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)
**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)) - 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))
## [v1.1.4](https://github.com/tj-actions/changed-files/tree/v1.1.4) (2021-12-14) ## [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/v11.9...v1.1.4) [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 +48,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))
@@ -122,7 +147,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/v1.2.0...v1.2.1) [Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.5...v1.2.1)
**Implemented enhancements:** **Implemented enhancements:**
@@ -136,13 +161,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))
## [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.5...v1.2.0)
## [v11.5](https://github.com/tj-actions/changed-files/tree/v11.5) (2021-10-30) ## [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) [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)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.4...v1.2.0)
**Merged pull requests:** **Merged pull requests:**

View File

@@ -33,16 +33,6 @@ Retrieve all changed files relative to the default branch (`pull_request*` based
* 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. * [Regex pattern](https://www.gnu.org/software/grep/manual/grep.html#Regular-Expressions) 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
> NOTE: :warning: > NOTE: :warning:
@@ -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@v12.1
- 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@v12.1
- 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@v12.1
with: with:
separator: "," separator: ","
@@ -165,18 +155,18 @@ 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@v12.1
with: with:
files: | files: |
my-file.txt my-file.txt
@@ -189,12 +179,12 @@ Support this project with a :star:
^(mynewfile|custom) ^(mynewfile|custom)
- 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 +204,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@v12.1
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@v12.1
with: with:
files_from_source_file: | files_from_source_file: |
test/changed-files-list.txt test/changed-files-list.txt
@@ -230,13 +220,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@v12.1
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@v12.1
with: with:
base_sha: "2096ed0" base_sha: "2096ed0"
@@ -248,7 +238,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@v12.1
with: with:
path: dir1 path: dir1
@@ -260,9 +250,9 @@ 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@v12.1
with: with:
since_last_remote_commit: 'true' since_last_remote_commit: "true"
``` ```
@@ -277,7 +267,7 @@ Support this project with a :star:
- 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@v12.1
- name: Pre-commit - name: Pre-commit
uses: pre-commit/action@v2.0.0 uses: pre-commit/action@v2.0.0
@@ -340,7 +330,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

View File

@@ -126,14 +126,14 @@ 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"
else 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
@@ -156,14 +156,14 @@ 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"
else 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
@@ -192,10 +192,12 @@ else
else 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