From 763842f2b1b1d40f79d392995ea82129dab9a1e2 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 05:58:42 -0500 Subject: [PATCH 01/20] Update action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index c40b5fcc..5ef5271d 100644 --- a/action.yml +++ b/action.yml @@ -60,6 +60,7 @@ runs: echo "::set-output name=unknown_files::$(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)" echo "::set-output name=all_changed_files::$(git diff --diff-filter="*" --name-only ${HEAD_SHA} || true)" shell: bash + branding: icon: git-pull-request color: white From 9590dcf67bd276af95343c0b1118bad6a7986c75 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 05:59:46 -0500 Subject: [PATCH 02/20] Update test.yml --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3bb7251..7ebe1002 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,8 +15,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: shellcheck - uses: reviewdog/action-shellcheck@v1 - name: Run changed-files id: changed-files uses: ./ From 471572469c57409980c12bbe4e6274818b14a1aa Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:03:04 -0500 Subject: [PATCH 03/20] Update action.yml --- action.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 5ef5271d..b93ff0de 100644 --- a/action.yml +++ b/action.yml @@ -10,22 +10,31 @@ inputs: outputs: added_files: description: List of added files. + value: ${{ steps.changed-files.outputs.added_files }} copied_files: description: List of copied files. + value: ${{ steps.changed-files.outputs.copied_files }} deleted_files: description: List of deleted files. + value: ${{ steps.changed-files.outputs.deleted_files }} modified_files: - description: List of modified files + description: List of modified files. + value: ${{ steps.changed-files.outputs.modified_files }} renamed_files: description: List of renamed files. + value: ${{ steps.changed-files.outputs.renamed_files }} changed_files: - description: List of changed files + description: List of changed files. + value: ${{ steps.changed-files.outputs.changed_files }} unmerged_files: description: List of unmerged files. + value: ${{ steps.changed-files.outputs.unmerged_files }} unknown_files: description: List of unknown files. + value: ${{ steps.changed-files.outputs.unknown_files }} all_changed_files: description: List of all changed files. + value: ${{ steps.changed-files.outputs.all_changed_files }} runs: using: 'composite' From c8f612d6e8494e3ab3ee1a457ad39d07444e6233 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:04:21 -0500 Subject: [PATCH 04/20] Update HISTORY.md --- HISTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.md b/HISTORY.md index 4d01e237..636473cf 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,7 @@ History ------- + v1 (2021-03-04) ------------------ From fbeabde486cfdfb2bf9039457a9105f323635bab Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:11:59 -0500 Subject: [PATCH 05/20] Update action.yml --- action.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index b93ff0de..3305229a 100644 --- a/action.yml +++ b/action.yml @@ -57,17 +57,27 @@ runs: echo "Getting head sha..." HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true) + + ADDED_FILES="$(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)" + COPIED_FILES="$(git diff --diff-filter=C --name-only ${HEAD_SHA} || true)" + DELETED_FILES="$(git diff --diff-filter=D --name-only ${HEAD_SHA} || true)" + MODIFIED_FILES="$(git diff --diff-filter=M --name-only ${HEAD_SHA} || true)" + RENAMED_FILES="$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)" + CHANGED_FILES="$(git diff --diff-filter=T --name-only ${HEAD_SHA} || true)" + UNMERGED_FILES="$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)" + UNKNOWN_FILES="$(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)" + ALL_CHANGED_FILES="$(git diff --diff-filter="*" --name-only ${HEAD_SHA} || true)" echo "Getting diff..." - echo "::set-output name=added_files::$(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)" - echo "::set-output name=copied_files::$(git diff --diff-filter=C --name-only ${HEAD_SHA} || true)" - echo "::set-output name=deleted_files::$(git diff --diff-filter=D --name-only ${HEAD_SHA} || true)" - echo "::set-output name=modified_files::$(git diff --diff-filter=M --name-only ${HEAD_SHA} || true)" - echo "::set-output name=renamed_files::$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)" - echo "::set-output name=changed_files::$(git diff --diff-filter=T --name-only ${HEAD_SHA} || true)" - echo "::set-output name=unmerged_files::$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)" - echo "::set-output name=unknown_files::$(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)" - echo "::set-output name=all_changed_files::$(git diff --diff-filter="*" --name-only ${HEAD_SHA} || true)" + echo "::set-output name=added_files::$ADDED_FILES" + echo "::set-output name=copied_files::$COPIED_FILES" + echo "::set-output name=deleted_files::$DELETED_FILES" + echo "::set-output name=modified_files::$MODIFIED_FILES" + echo "::set-output name=renamed_files::$RENAMED_FILES" + echo "::set-output name=changed_files::$CHANGED_FILES" + echo "::set-output name=unmerged_files::$UNMERGED_FILES" + echo "::set-output name=unknown_files::$UNKNOWN_FILES" + echo "::set-output name=all_changed_files::$ALL_CHANGED_FILES" shell: bash branding: From 3e4883b992181f925bbd41ef9f428238fa6fd2dd Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:15:01 -0500 Subject: [PATCH 06/20] Update test.yml --- .github/workflows/test.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7ebe1002..7adb0caa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,13 +20,5 @@ jobs: uses: ./ - name: Show output run: | - echo "Added Files: ${{ steps.changed-files.outputs.added_files }}" - echo "Copied Files: ${{ steps.changed-files.outputs.copied_files }}" - echo "Deleted Files: ${{ steps.changed-files.outputs.deleted_files }}" - echo "Modified Files: ${{ steps.changed-files.outputs.modified_files }}" - echo "Renamed Files: ${{ steps.changed-files.outputs.renamed_files }}" - echo "Changed Files: ${{ steps.changed-files.outputs.changed_files }}" - echo "Unmerged Files: ${{ steps.changed-files.outputs.unmerged_files }}" - echo "Unknown Files: ${{ steps.changed-files.outputs.unknown_files }}" - echo "All Changed Files: ${{ steps.changed-files.outputs.all_changed_files }}" + echo "${{ steps.changed-files.output }}" From ef3cd7549b9e4f459c373c95cc3a31661911eb2c Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:15:46 -0500 Subject: [PATCH 07/20] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7adb0caa..f84b2ab8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,5 +20,5 @@ jobs: uses: ./ - name: Show output run: | - echo "${{ steps.changed-files.output }}" + echo "${{ steps.changed-files.outputs }}" From 7cb6f929141ed08eaefb9b862ed070564ee461a3 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:17:27 -0500 Subject: [PATCH 08/20] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f84b2ab8..beb506ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,5 +20,5 @@ jobs: uses: ./ - name: Show output run: | - echo "${{ steps.changed-files.outputs }}" + echo "${{ toJSON(steps.changed-files.outputs) }}" From b7160b4c97f849fa73785ffacfd37af680335ce4 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:25:28 -0500 Subject: [PATCH 09/20] Update action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 3305229a..45fac970 100644 --- a/action.yml +++ b/action.yml @@ -56,6 +56,7 @@ runs: git fetch --depth=1 origin ${TARGET_BRANCH}:${TARGET_BRANCH} echo "Getting head sha..." + HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true) ADDED_FILES="$(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)" From 7f553e5eaca6bf3e277bb0c838c19ff5987e42c0 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:30:34 -0500 Subject: [PATCH 10/20] Update action.yml --- action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 45fac970..e5e227a5 100644 --- a/action.yml +++ b/action.yml @@ -59,15 +59,15 @@ runs: HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true) - ADDED_FILES="$(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)" - COPIED_FILES="$(git diff --diff-filter=C --name-only ${HEAD_SHA} || true)" - DELETED_FILES="$(git diff --diff-filter=D --name-only ${HEAD_SHA} || true)" - MODIFIED_FILES="$(git diff --diff-filter=M --name-only ${HEAD_SHA} || true)" - RENAMED_FILES="$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)" - CHANGED_FILES="$(git diff --diff-filter=T --name-only ${HEAD_SHA} || true)" - UNMERGED_FILES="$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)" - UNKNOWN_FILES="$(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)" - ALL_CHANGED_FILES="$(git diff --diff-filter="*" --name-only ${HEAD_SHA} || true)" + ADDED_FILES=($(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)) + COPIED_FILES=($(git diff --diff-filter=C --name-only ${HEAD_SHA} || true)) + DELETED_FILES=($(git diff --diff-filter=D --name-only ${HEAD_SHA} || true)) + MODIFIED_FILES=($(git diff --diff-filter=M --name-only ${HEAD_SHA} || true)) + RENAMED_FILES=($(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)) + CHANGED_FILES=($(git diff --diff-filter=T --name-only ${HEAD_SHA} || true)) + UNMERGED_FILES=($(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)) + UNKNOWN_FILES=($(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)) + ALL_CHANGED_FILES=($(git diff --diff-filter="*" --name-only ${HEAD_SHA} || true)) echo "Getting diff..." echo "::set-output name=added_files::$ADDED_FILES" From c779b1b3a420a36b8d2f0e1fbf2894cecfd22fe3 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:42:06 -0500 Subject: [PATCH 11/20] Update action.yml --- action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index e5e227a5..e43bf502 100644 --- a/action.yml +++ b/action.yml @@ -59,15 +59,15 @@ runs: HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true) - ADDED_FILES=($(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)) - COPIED_FILES=($(git diff --diff-filter=C --name-only ${HEAD_SHA} || true)) - DELETED_FILES=($(git diff --diff-filter=D --name-only ${HEAD_SHA} || true)) - MODIFIED_FILES=($(git diff --diff-filter=M --name-only ${HEAD_SHA} || true)) - RENAMED_FILES=($(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)) - CHANGED_FILES=($(git diff --diff-filter=T --name-only ${HEAD_SHA} || true)) - UNMERGED_FILES=($(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)) - UNKNOWN_FILES=($(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)) - ALL_CHANGED_FILES=($(git diff --diff-filter="*" --name-only ${HEAD_SHA} || true)) + read -a ADDED_FILES <<< "$(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)" + read -a COPIED_FILES <<< "$(git diff --diff-filter=C --name-only ${HEAD_SHA} || true)" + read -a DELETED_FILES <<< "$(git diff --diff-filter=D --name-only ${HEAD_SHA} || true)" + read -a MODIFIED_FILES <<< "$(git diff --diff-filter=M --name-only ${HEAD_SHA} || true)" + read -a RENAMED_FILES <<< "$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)" + read -a CHANGED_FILES <<< "$(git diff --diff-filter=T --name-only ${HEAD_SHA} || true)" + read -a UNMERGED_FILES <<< "$(git diff --diff-filter=U --name-only ${HEAD_SHA} || true)" + read -a UNKNOWN_FILES <<< "$(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)" + read -a ALL_CHANGED_FILES <<< "$(git diff --diff-filter='*' --name-only ${HEAD_SHA} || true)" echo "Getting diff..." echo "::set-output name=added_files::$ADDED_FILES" From f27a974eb0ea47477b96cd3174240edecd2f3582 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:46:46 -0500 Subject: [PATCH 12/20] Update action.yml --- action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index e43bf502..ec8ff2ca 100644 --- a/action.yml +++ b/action.yml @@ -70,15 +70,15 @@ runs: read -a ALL_CHANGED_FILES <<< "$(git diff --diff-filter='*' --name-only ${HEAD_SHA} || true)" echo "Getting diff..." - echo "::set-output name=added_files::$ADDED_FILES" - echo "::set-output name=copied_files::$COPIED_FILES" - echo "::set-output name=deleted_files::$DELETED_FILES" - echo "::set-output name=modified_files::$MODIFIED_FILES" - echo "::set-output name=renamed_files::$RENAMED_FILES" - echo "::set-output name=changed_files::$CHANGED_FILES" - echo "::set-output name=unmerged_files::$UNMERGED_FILES" - echo "::set-output name=unknown_files::$UNKNOWN_FILES" - echo "::set-output name=all_changed_files::$ALL_CHANGED_FILES" + echo "::set-output name=added_files::${{ toJSON($ADDED_FILES) }}" + echo "::set-output name=copied_files::${{ toJSON($COPIED_FILES) }}" + echo "::set-output name=deleted_files::${{ toJSON($DELETED_FILES) }}" + echo "::set-output name=modified_files::${{ toJSON($MODIFIED_FILES) }}" + echo "::set-output name=renamed_files::${{ toJSON($RENAMED_FILES) }}" + echo "::set-output name=changed_files::${{ toJSON($CHANGED_FILES) }}" + echo "::set-output name=unmerged_files::${{ toJSON($UNMERGED_FILES) }}" + echo "::set-output name=unknown_files::${{ toJSON($UNKNOWN_FILES) }}" + echo "::set-output name=all_changed_files::${{ toJSON($ALL_CHANGED_FILES) }}" shell: bash branding: From fa35dfda3d6e5605964a0ea42b0300cefac042d5 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 06:51:02 -0500 Subject: [PATCH 13/20] Update action.yml --- action.yml | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/action.yml b/action.yml index ec8ff2ca..b2eefbcd 100644 --- a/action.yml +++ b/action.yml @@ -58,27 +58,17 @@ runs: echo "Getting head sha..." HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true) - - read -a ADDED_FILES <<< "$(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)" - read -a COPIED_FILES <<< "$(git diff --diff-filter=C --name-only ${HEAD_SHA} || true)" - read -a DELETED_FILES <<< "$(git diff --diff-filter=D --name-only ${HEAD_SHA} || true)" - read -a MODIFIED_FILES <<< "$(git diff --diff-filter=M --name-only ${HEAD_SHA} || true)" - read -a RENAMED_FILES <<< "$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)" - read -a CHANGED_FILES <<< "$(git diff --diff-filter=T --name-only ${HEAD_SHA} || true)" - read -a UNMERGED_FILES <<< "$(git diff --diff-filter=U --name-only ${HEAD_SHA} || true)" - read -a UNKNOWN_FILES <<< "$(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)" - read -a ALL_CHANGED_FILES <<< "$(git diff --diff-filter='*' --name-only ${HEAD_SHA} || true)" echo "Getting diff..." - echo "::set-output name=added_files::${{ toJSON($ADDED_FILES) }}" - echo "::set-output name=copied_files::${{ toJSON($COPIED_FILES) }}" - echo "::set-output name=deleted_files::${{ toJSON($DELETED_FILES) }}" - echo "::set-output name=modified_files::${{ toJSON($MODIFIED_FILES) }}" - echo "::set-output name=renamed_files::${{ toJSON($RENAMED_FILES) }}" - echo "::set-output name=changed_files::${{ toJSON($CHANGED_FILES) }}" - echo "::set-output name=unmerged_files::${{ toJSON($UNMERGED_FILES) }}" - echo "::set-output name=unknown_files::${{ toJSON($UNKNOWN_FILES) }}" - echo "::set-output name=all_changed_files::${{ toJSON($ALL_CHANGED_FILES) }}" + echo "::set-output name=added_files::${{ $(git diff --diff-filter=A --name-only ${HEAD_SHA} || true) }}" + echo "::set-output name=copied_files::${{ $(git diff --diff-filter=C --name-only ${HEAD_SHA} || true) }}" + echo "::set-output name=deleted_files::${{ $(git diff --diff-filter=D --name-only ${HEAD_SHA} || true) }}" + echo "::set-output name=modified_files::${{ $(git diff --diff-filter=M --name-only ${HEAD_SHA} || true) }}" + echo "::set-output name=renamed_files::${{ $(git diff --diff-filter=R --name-only ${HEAD_SHA} || true) }}" + echo "::set-output name=changed_files::${{ $(git diff --diff-filter=T --name-only ${HEAD_SHA} || true) }}" + echo "::set-output name=unmerged_files::${{ $(git diff --diff-filter=U --name-only ${HEAD_SHA} || true) }}" + echo "::set-output name=unknown_files::${{ $(git diff --diff-filter=X --name-only ${HEAD_SHA} || true) }}" + echo "::set-output name=all_changed_files::${{ $(git diff --diff-filter='*' --name-only ${HEAD_SHA} || true) }}" shell: bash branding: From 3e5dc55ea76a1293a45f5c731968c914f13ceeff Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 07:05:13 -0500 Subject: [PATCH 14/20] Update action.yml --- action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index b2eefbcd..d02e232e 100644 --- a/action.yml +++ b/action.yml @@ -60,15 +60,15 @@ runs: HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true) echo "Getting diff..." - echo "::set-output name=added_files::${{ $(git diff --diff-filter=A --name-only ${HEAD_SHA} || true) }}" - echo "::set-output name=copied_files::${{ $(git diff --diff-filter=C --name-only ${HEAD_SHA} || true) }}" - echo "::set-output name=deleted_files::${{ $(git diff --diff-filter=D --name-only ${HEAD_SHA} || true) }}" - echo "::set-output name=modified_files::${{ $(git diff --diff-filter=M --name-only ${HEAD_SHA} || true) }}" - echo "::set-output name=renamed_files::${{ $(git diff --diff-filter=R --name-only ${HEAD_SHA} || true) }}" - echo "::set-output name=changed_files::${{ $(git diff --diff-filter=T --name-only ${HEAD_SHA} || true) }}" - echo "::set-output name=unmerged_files::${{ $(git diff --diff-filter=U --name-only ${HEAD_SHA} || true) }}" - echo "::set-output name=unknown_files::${{ $(git diff --diff-filter=X --name-only ${HEAD_SHA} || true) }}" - echo "::set-output name=all_changed_files::${{ $(git diff --diff-filter='*' --name-only ${HEAD_SHA} || true) }}" + echo "::set-output name=added_files::${$(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)//$'\n'/}" + echo "::set-output name=copied_files::${$(git diff --diff-filter=C --name-only ${HEAD_SHA} || true)//$'\n'/}" + echo "::set-output name=deleted_files::${$(git diff --diff-filter=D --name-only ${HEAD_SHA} || true)//$'\n'/}" + echo "::set-output name=modified_files::${$(git diff --diff-filter=M --name-only ${HEAD_SHA} || true)//$'\n'/}" + echo "::set-output name=renamed_files::${$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)//$'\n'/}" + echo "::set-output name=changed_files::${$(git diff --diff-filter=T --name-only ${HEAD_SHA} || true)//$'\n'/}" + echo "::set-output name=unmerged_files::${$(git diff --diff-filter=U --name-only ${HEAD_SHA} || true)//$'\n'/}" + echo "::set-output name=unknown_files::${$(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)//$'\n'/}" + echo "::set-output name=all_changed_files::${$(git diff --diff-filter='*' --name-only ${HEAD_SHA} || true)//$'\n'/}" shell: bash branding: From 73e787415d0a956e99afbaa75814187292a689f9 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 07:13:15 -0500 Subject: [PATCH 15/20] Update action.yml --- action.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index d02e232e..34961dd9 100644 --- a/action.yml +++ b/action.yml @@ -58,17 +58,27 @@ runs: echo "Getting head sha..." HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true) + + ADDED=${$(git diff --diff-filter=A --name-only "$HEAD_SHA" || true)//$'\n'/} + COPIED=${$(git diff --diff-filter=C --name-only "$HEAD_SHA" || true)//$'\n'/} + DELETED=${$(git diff --diff-filter=D --name-only "$HEAD_SHA" || true)//$'\n'/} + MODIFIED=${$(git diff --diff-filter=M --name-only "$HEAD_SHA" || true)//$'\n'/} + RENAMED=${$(git diff --diff-filter=R --name-only "$HEAD_SHA" || true)//$'\n'/} + CHANGED=${$(git diff --diff-filter=T --name-only "$HEAD_SHA" || true)//$'\n'/} + UNMERGED=${$(git diff --diff-filter=U --name-only "$HEAD_SHA" || true)//$'\n'/} + UNKNOWN=${$(git diff --diff-filter=X --name-only "$HEAD_SHA" || true)//$'\n'/} + ALL_CHANGED=${$(git diff --diff-filter='*' --name-only "$HEAD_SHA" || true)//$'\n'/} echo "Getting diff..." - echo "::set-output name=added_files::${$(git diff --diff-filter=A --name-only ${HEAD_SHA} || true)//$'\n'/}" - echo "::set-output name=copied_files::${$(git diff --diff-filter=C --name-only ${HEAD_SHA} || true)//$'\n'/}" - echo "::set-output name=deleted_files::${$(git diff --diff-filter=D --name-only ${HEAD_SHA} || true)//$'\n'/}" - echo "::set-output name=modified_files::${$(git diff --diff-filter=M --name-only ${HEAD_SHA} || true)//$'\n'/}" - echo "::set-output name=renamed_files::${$(git diff --diff-filter=R --name-only ${HEAD_SHA} || true)//$'\n'/}" - echo "::set-output name=changed_files::${$(git diff --diff-filter=T --name-only ${HEAD_SHA} || true)//$'\n'/}" - echo "::set-output name=unmerged_files::${$(git diff --diff-filter=U --name-only ${HEAD_SHA} || true)//$'\n'/}" - echo "::set-output name=unknown_files::${$(git diff --diff-filter=X --name-only ${HEAD_SHA} || true)//$'\n'/}" - echo "::set-output name=all_changed_files::${$(git diff --diff-filter='*' --name-only ${HEAD_SHA} || true)//$'\n'/}" + echo "::set-output name=added_files::$ADDED" + echo "::set-output name=copied_files::$COPIED" + echo "::set-output name=deleted_files::$DELETED" + echo "::set-output name=modified_files::$MODIFIED" + echo "::set-output name=renamed_files::$RENAMED" + echo "::set-output name=changed_files::$CHANGED" + echo "::set-output name=unmerged_files::$UNMERGED" + echo "::set-output name=unknown_files::$UNKNOWN" + echo "::set-output name=all_changed_files::$ALL_CHANGED" shell: bash branding: From cee7cbf35c8d6e74d2d33c686db4f1703eb4b6a4 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 07:17:26 -0500 Subject: [PATCH 16/20] Update action.yml --- action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 34961dd9..d5db7420 100644 --- a/action.yml +++ b/action.yml @@ -59,15 +59,15 @@ runs: HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true) - ADDED=${$(git diff --diff-filter=A --name-only "$HEAD_SHA" || true)//$'\n'/} - COPIED=${$(git diff --diff-filter=C --name-only "$HEAD_SHA" || true)//$'\n'/} - DELETED=${$(git diff --diff-filter=D --name-only "$HEAD_SHA" || true)//$'\n'/} - MODIFIED=${$(git diff --diff-filter=M --name-only "$HEAD_SHA" || true)//$'\n'/} - RENAMED=${$(git diff --diff-filter=R --name-only "$HEAD_SHA" || true)//$'\n'/} - CHANGED=${$(git diff --diff-filter=T --name-only "$HEAD_SHA" || true)//$'\n'/} - UNMERGED=${$(git diff --diff-filter=U --name-only "$HEAD_SHA" || true)//$'\n'/} - UNKNOWN=${$(git diff --diff-filter=X --name-only "$HEAD_SHA" || true)//$'\n'/} - ALL_CHANGED=${$(git diff --diff-filter='*' --name-only "$HEAD_SHA" || true)//$'\n'/} + ADDED=$(git diff --diff-filter=A --name-only "$HEAD_SHA" | xargs ) + COPIED=$(git diff --diff-filter=C --name-only "$HEAD_SHA" | xargs ) + DELETED=$(git diff --diff-filter=D --name-only "$HEAD_SHA" | xargs ) + MODIFIED=$(git diff --diff-filter=M --name-only "$HEAD_SHA" | xargs ) + RENAMED=$(git diff --diff-filter=R --name-only "$HEAD_SHA" | xargs ) + CHANGED=$(git diff --diff-filter=T --name-only "$HEAD_SHA" | xargs ) + UNMERGED=$(git diff --diff-filter=U --name-only "$HEAD_SHA" | xargs ) + UNKNOWN=$(git diff --diff-filter=X --name-only "$HEAD_SHA" | xargs ) + ALL_CHANGED=$(git diff --diff-filter='*' --name-only "$HEAD_SHA" | xargs ) echo "Getting diff..." echo "::set-output name=added_files::$ADDED" From 2c3bf3cbc46c7bfc5c8b53d3fe02c5cddf51a588 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 07:25:17 -0500 Subject: [PATCH 17/20] Update action.yml --- action.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/action.yml b/action.yml index d5db7420..39983ef6 100644 --- a/action.yml +++ b/action.yml @@ -2,11 +2,11 @@ name: Get modified files description: Get modified files author: tj-actions inputs: - token: - description: 'GITHUB_TOKEN or a Repo scoped PAT' + separator: + description: 'Split character for array output' required: true - default: ${{ github.token }} - + default: " " + outputs: added_files: description: List of added files. @@ -59,15 +59,15 @@ runs: HEAD_SHA=$(git rev-parse ${TARGET_BRANCH} || true) - ADDED=$(git diff --diff-filter=A --name-only "$HEAD_SHA" | xargs ) - COPIED=$(git diff --diff-filter=C --name-only "$HEAD_SHA" | xargs ) - DELETED=$(git diff --diff-filter=D --name-only "$HEAD_SHA" | xargs ) - MODIFIED=$(git diff --diff-filter=M --name-only "$HEAD_SHA" | xargs ) - RENAMED=$(git diff --diff-filter=R --name-only "$HEAD_SHA" | xargs ) - CHANGED=$(git diff --diff-filter=T --name-only "$HEAD_SHA" | xargs ) - UNMERGED=$(git diff --diff-filter=U --name-only "$HEAD_SHA" | xargs ) - UNKNOWN=$(git diff --diff-filter=X --name-only "$HEAD_SHA" | xargs ) - ALL_CHANGED=$(git diff --diff-filter='*' --name-only "$HEAD_SHA" | xargs ) + ADDED=$(git diff --diff-filter=A --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" ) + COPIED=$(git diff --diff-filter=C --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" ) + DELETED=$(git diff --diff-filter=D --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" ) + MODIFIED=$(git diff --diff-filter=M --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" ) + RENAMED=$(git diff --diff-filter=R --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" ) + CHANGED=$(git diff --diff-filter=T --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" ) + UNMERGED=$(git diff --diff-filter=U --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" ) + UNKNOWN=$(git diff --diff-filter=X --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" ) + ALL_CHANGED=$(git diff --diff-filter='*' --name-only "$HEAD_SHA" | tr "\n" "${{ inputs.separator }}" ) echo "Getting diff..." echo "::set-output name=added_files::$ADDED" From 678aa7487a8af738bdfb6e024ccc7a9eb4d9d719 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 07:28:53 -0500 Subject: [PATCH 18/20] Update test.yml --- .github/workflows/test.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index beb506ff..7b6d8f66 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,10 +15,25 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Run changed-files + - 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 comma separator + id: changed-files-comma + uses: ./ + with: + separator: "," + - name: Show output + run: | + echo "${{ toJSON(steps.changed-files-comma.outputs) }}" + - name: Run changed-files with pipe + id: changed-files-pipe + uses: ./ + with: + separator: "|" + - name: Show output + run: | + echo "${{ toJSON(steps.changed-files-pipe.outputs) }}" From 980c2260350667c62ee4e34e3d293978ec206098 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 07:32:36 -0500 Subject: [PATCH 19/20] Update action.yml --- action.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/action.yml b/action.yml index 39983ef6..179d4c24 100644 --- a/action.yml +++ b/action.yml @@ -49,10 +49,6 @@ runs: TARGET_BRANCH=${GITHUB_BASE_REF} CURRENT_BRANCH=${GITHUB_HEAD_REF} - echo "Getting base branch..." - git config --local remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - git config --local --add remote.origin.fetch "+refs/tags/*:refs/tags/*" - git fetch --depth=1 origin ${TARGET_BRANCH}:${TARGET_BRANCH} echo "Getting head sha..." From 8d4aa1c912a70b54881939df1381b99a57fca6d9 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 5 Mar 2021 07:38:19 -0500 Subject: [PATCH 20/20] Update test.yml --- .github/workflows/test.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b6d8f66..164c38f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,11 +29,3 @@ jobs: - name: Show output run: | echo "${{ toJSON(steps.changed-files-comma.outputs) }}" - - name: Run changed-files with pipe - id: changed-files-pipe - uses: ./ - with: - separator: "|" - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-pipe.outputs) }}"