Compare commits

...

10 Commits
v9 ... v9.2

Author SHA1 Message Date
Tonye Jack
75933dc40b Dedupe output file names. (#153) 2021-08-06 06:14:50 -04:00
Tonye Jack
dc688ad0b2 Update README.md 2021-08-04 15:49:55 -04:00
Renovate Bot
5cab6c42e2 Update tj-actions/branch-names action to v4.8 2021-08-04 15:39:42 -04:00
Tonye Jack
cc5b16fc9d Updated .github/ISSUE_TEMPLATE/bug_report.yaml 2021-08-02 18:16:39 -04:00
Tonye Jack
ba01a24d10 Added .github/workflows/codacy-analysis.yml 2021-07-30 13:34:38 -04:00
Tonye Jack
a48d12ad38 Deleted .github/workflows/codacy-analysis.yml 2021-07-30 13:32:11 -04:00
Tonye Jack
dfe8a2779d Upgraded to v9.1 (#150)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2021-07-30 12:30:32 -04:00
Tonye Jack
2c0d12b627 Detect deleted files via any_changed output (#149) 2021-07-30 12:14:01 -04:00
Renovate Bot
3a01bb540d Update reviewdog/action-shellcheck action to v1.7 2021-07-26 12:44:49 -04:00
Tonye Jack
fba57fd3c6 Upgraded to v9 (#146)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2021-07-24 08:59:50 -04:00
5 changed files with 85 additions and 35 deletions

View File

@@ -41,6 +41,7 @@ body:
label: What OS are you seeing the problem on? label: What OS are you seeing the problem on?
multiple: true multiple: true
options: options:
- all
- ubuntu-latest or ubuntu-20.04 - ubuntu-latest or ubuntu-20.04
- ubuntu-18.04 - ubuntu-18.04
- macos-latest or macos-10.15 - macos-latest or macos-10.15

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.6 uses: reviewdog/action-shellcheck@v1.7
test-no-head-sha: test-no-head-sha:
name: Test changed-files missing head sha name: Test changed-files missing head sha
@@ -108,6 +108,25 @@ jobs:
echo "${{ toJSON(steps.changed-files-specific.outputs) }}" echo "${{ toJSON(steps.changed-files-specific.outputs) }}"
shell: shell:
bash bash
- name: Run changed-files with specific files comma check duplicates
id: changed-files-specific-duplicate-output
uses: ./
with:
files: |
entrypoint.sh
*.sh
- name: Verify all_changed_files files has no duplicates
if: contains(steps.changed-files-specific-duplicate-output.outputs.all_modified_files, 'entrypoint.sh')
run: |
ALL_CHANGED_FILES=(${{ steps.changed-files-specific-duplicate-output.outputs.all_modified_files }})
UNIQUE_ALL_CHANGED_FILES=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | sort -u | xargs)
if [[ "$ALL_CHANGED_FILES[@]" != "$UNIQUE_ALL_CHANGED_FILES[@]" ]]; then
echo "Duplicate output: Expected "$UNIQUE_ALL_CHANGED_FILES" got $ALL_CHANGED_FILES"
exit 1
fi
shell:
bash
- name: Run changed-files with specific files comma separator - name: Run changed-files with specific files comma separator
id: changed-files-specific-comma id: changed-files-specific-comma
uses: ./ uses: ./
@@ -181,7 +200,7 @@ jobs:
bash bash
- name: Get branch name - name: Get branch name
id: branch-name id: branch-name
uses: tj-actions/branch-names@v4.5 uses: tj-actions/branch-names@v4.8
- uses: nrwl/last-successful-commit-action@v1 - uses: nrwl/last-successful-commit-action@v1
id: last_successful_commit id: last_successful_commit
with: with:

View File

@@ -1,5 +1,38 @@
# Changelog # Changelog
## [v9.1](https://github.com/tj-actions/changed-files/tree/v9.1) (2021-07-30)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v9...v9.1)
**Implemented enhancements:**
- \[Feature\] any\_changed doesn't capture changes due to deleting files [\#148](https://github.com/tj-actions/changed-files/issues/148)
**Closed issues:**
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
**Merged pull requests:**
- Detect deleted files via any\_changed output [\#149](https://github.com/tj-actions/changed-files/pull/149) ([jackton1](https://github.com/jackton1))
- Update reviewdog/action-shellcheck action to v1.7 [\#147](https://github.com/tj-actions/changed-files/pull/147) ([renovate[bot]](https://github.com/apps/renovate))
- Upgraded to v9 [\#146](https://github.com/tj-actions/changed-files/pull/146) ([jackton1](https://github.com/jackton1))
## [v9](https://github.com/tj-actions/changed-files/tree/v9) (2021-07-24)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.9...v9)
**Fixed bugs:**
- \[BUG\] \<any\_changed doesn't capture changes due to renaming files\> [\#144](https://github.com/tj-actions/changed-files/issues/144)
**Merged pull requests:**
- Update `any_changed` to include renamed files. [\#145](https://github.com/tj-actions/changed-files/pull/145) ([jackton1](https://github.com/jackton1))
- Update codacy/codacy-analysis-cli-action action to v4 [\#143](https://github.com/tj-actions/changed-files/pull/143) ([renovate[bot]](https://github.com/apps/renovate))
- Update codacy/codacy-analysis-cli-action action to v3 [\#142](https://github.com/tj-actions/changed-files/pull/142) ([renovate[bot]](https://github.com/apps/renovate))
- Upgraded to v8.9 [\#140](https://github.com/tj-actions/changed-files/pull/140) ([jackton1](https://github.com/jackton1))
## [v8.9](https://github.com/tj-actions/changed-files/tree/v8.9) (2021-07-18) ## [v8.9](https://github.com/tj-actions/changed-files/tree/v8.9) (2021-07-18)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.8...v8.9) [Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.8...v8.9)
@@ -68,10 +101,6 @@
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.3...v8.4) [Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.3...v8.4)
**Closed issues:**
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
**Merged pull requests:** **Merged pull requests:**
- Update reviewdog/action-shellcheck action to v1.6 [\#118](https://github.com/tj-actions/changed-files/pull/118) ([renovate[bot]](https://github.com/apps/renovate)) - Update reviewdog/action-shellcheck action to v1.6 [\#118](https://github.com/tj-actions/changed-files/pull/118) ([renovate[bot]](https://github.com/apps/renovate))
@@ -135,7 +164,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.3...v7) [Full Changelog](https://github.com/tj-actions/changed-files/compare/v6...v7)
**Closed issues:** **Closed issues:**
@@ -151,13 +180,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.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...v6.3)
## [v6](https://github.com/tj-actions/changed-files/tree/v6) (2021-05-26) ## [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) [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)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.2...v6.3)
**Merged pull requests:** **Merged pull requests:**

View File

@@ -12,6 +12,7 @@ Retrieve all changed files relative to the default branch (`pull_request*` based
## Features ## Features
* Easy to debug.
* Boolean output indicating that certain files have been modified. * Boolean output indicating that certain files have been modified.
* List all files that have changed. * List all files that have changed.
* Between the current pull request branch and the default branch. * Between the current pull request branch and the default branch.
@@ -55,7 +56,7 @@ jobs:
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v8.9 uses: tj-actions/changed-files@v9.1
- name: List all modified files - name: List all modified files
run: | run: |
@@ -79,7 +80,7 @@ jobs:
| Output | type | example | description | | Output | type | example | description |
|:--------------------:|:------------:|:----------------------------------:|:----------------------------------------:| |:--------------------:|:------------:|:----------------------------------:|:----------------------------------------:|
| any_changed | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has changed (ACMR) | | any_changed | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has changed (ACMDR) |
| only_changed | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input have changed. | | only_changed | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input have changed. |
| other_changed_files | `string` | `'new.txt path/to/file.png ...'` | Select all modified files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied and modified files (ACM).* | | other_changed_files | `string` | `'new.txt path/to/file.png ...'` | Select all modified files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied and modified files (ACM).* |
| all_modified_files | `string` | `'new.txt path/to/file.png ...'` | Select all modified 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 modified files <br /> i.e. *a combination of all added, <br />copied, modified and renamed files (ACMR).* |
@@ -113,11 +114,11 @@ jobs:
- name: Get changed files using defaults - name: Get changed files using defaults
id: changed-files id: changed-files
uses: tj-actions/changed-files@v8.9 uses: tj-actions/changed-files@v9.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@v8.9 uses: tj-actions/changed-files@v9.1
with: with:
separator: "," separator: ","
@@ -139,7 +140,7 @@ jobs:
- name: Get specific changed files - name: Get specific changed files
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v8.9 uses: tj-actions/changed-files@v9.1
with: with:
files: | files: |
my-file.txt my-file.txt
@@ -162,14 +163,14 @@ jobs:
- 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@v8.9 uses: tj-actions/changed-files@v9.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@v8.9 uses: tj-actions/changed-files@v9.1
with: with:
files_from_source_file: | files_from_source_file: |
test/changed-files-list.txt test/changed-files-list.txt
@@ -178,13 +179,13 @@ jobs:
- 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@v8.9 uses: tj-actions/changed-files@v9.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@v8.9 uses: tj-actions/changed-files@v9.1
with: with:
base_sha: "2096ed0" base_sha: "2096ed0"
@@ -201,7 +202,7 @@ jobs:
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v8.9 uses: tj-actions/changed-files@v9.1
- name: Pre-commit - name: Pre-commit
uses: pre-commit/action@v2.0.0 uses: pre-commit/action@v2.0.0

View File

@@ -64,7 +64,7 @@ if [[ -z "$UNIQUE_FILES" ]]; then
UNMERGED=$(git diff --diff-filter=U --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//") UNMERGED=$(git diff --diff-filter=U --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//")
UNKNOWN=$(git diff --diff-filter=X --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//") UNKNOWN=$(git diff --diff-filter=X --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//")
ALL_CHANGED=$(git diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//") ALL_CHANGED=$(git diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//")
ALL_MODIFIED_FILES=$(git diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//") ALL_MODIFIED_FILES=$(git diff --diff-filter="ACMDR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//")
else else
ADDED_ARRAY=() ADDED_ARRAY=()
COPIED_ARRAY=() COPIED_ARRAY=()
@@ -100,29 +100,29 @@ else
# shellcheck disable=SC2207 # shellcheck disable=SC2207
ALL_CHANGED_ARRAY+=($(git diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "(${path})" | xargs || true)) ALL_CHANGED_ARRAY+=($(git diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "(${path})" | xargs || true))
# shellcheck disable=SC2207 # shellcheck disable=SC2207
ALL_MODIFIED_FILES_ARRAY+=($(git diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "(${path})" | xargs || true)) ALL_MODIFIED_FILES_ARRAY+=($(git diff --diff-filter="ACMDR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "(${path})" | xargs || true))
done done
# shellcheck disable=SC2001 # shellcheck disable=SC2001
ADDED=$(echo "${ADDED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') ADDED=$(echo "${ADDED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
# shellcheck disable=SC2001 # shellcheck disable=SC2001
COPIED=$(echo "${COPIED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') COPIED=$(echo "${COPIED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
# shellcheck disable=SC2001 # shellcheck disable=SC2001
DELETED=$(echo "${DELETED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') DELETED=$(echo "${DELETED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
# shellcheck disable=SC2001 # shellcheck disable=SC2001
MODIFIED=$(echo "${MODIFIED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') MODIFIED=$(echo "${MODIFIED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
# shellcheck disable=SC2001 # shellcheck disable=SC2001
RENAMED=$(echo "${RENAMED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') RENAMED=$(echo "${RENAMED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
# shellcheck disable=SC2001 # shellcheck disable=SC2001
TYPE_CHANGED=$(echo "${TYPE_CHANGED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') TYPE_CHANGED=$(echo "${TYPE_CHANGED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
# shellcheck disable=SC2001 # shellcheck disable=SC2001
UNMERGED=$(echo "${UNMERGED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') UNMERGED=$(echo "${UNMERGED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
# shellcheck disable=SC2001 # shellcheck disable=SC2001
UNKNOWN=$(echo "${UNKNOWN_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') UNKNOWN=$(echo "${UNKNOWN_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
# shellcheck disable=SC2001 # shellcheck disable=SC2001
ALL_CHANGED=$(echo "${ALL_CHANGED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') ALL_CHANGED=$(echo "${ALL_CHANGED_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
# shellcheck disable=SC2001 # shellcheck disable=SC2001
ALL_MODIFIED_FILES=$(echo "${ALL_MODIFIED_FILES_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g') ALL_MODIFIED_FILES=$(echo "${ALL_MODIFIED_FILES_ARRAY[*]}" | sed 's/ */'"$INPUT_SEPARATOR"'/g' | tr ' ' '\n' | sort -u | xargs)
fi fi
echo "Added files: $ADDED" echo "Added files: $ADDED"
@@ -139,7 +139,7 @@ echo "All modified files: $ALL_MODIFIED_FILES"
if [[ -n "$UNIQUE_FILES" ]]; then if [[ -n "$UNIQUE_FILES" ]]; then
# shellcheck disable=SC2001 # shellcheck disable=SC2001
ALL_INPUT_FILES=$(echo "$UNIQUE_FILES" | tr "\n" " " | xargs) ALL_INPUT_FILES=$(echo "$UNIQUE_FILES" | tr "\n" " " | xargs)
ALL_OTHER_CHANGED_FILES=$(git diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA") ALL_OTHER_CHANGED_FILES=$(git diff --diff-filter="ACMDR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA")
OTHER_CHANGED_FILES=$(echo "${ALL_OTHER_CHANGED_FILES[@]}" "${ALL_MODIFIED_FILES[@]}" | tr ' ' '\n' | sort | uniq -u | tr "\n" " " | xargs) OTHER_CHANGED_FILES=$(echo "${ALL_OTHER_CHANGED_FILES[@]}" "${ALL_MODIFIED_FILES[@]}" | tr ' ' '\n' | sort | uniq -u | tr "\n" " " | xargs)