Compare commits

...

31 Commits
v37.6.0 ... v38

Author SHA1 Message Date
Tonye Jack
17f3fec1ed fix: error getting diff for submodules (#1473)
Co-authored-by: GitHub Action <action@github.com>
2023-08-22 22:26:07 -06:00
Tonye Jack
52dbf3e3cf chore: update test (#1469)
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-23 04:06:23 +00:00
renovate[bot]
0a814e4372 chore(deps): update dependency @types/jest to v29.5.4 (#1472)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-22 13:53:55 -06:00
Tonye Jack
fc63326544 fix: bug with locating the previous tag (#1470)
Co-authored-by: GitHub Action <action@github.com>
2023-08-22 13:41:54 -06:00
renovate[bot]
18bacaab15 chore(deps): update dependency @types/node to v20.5.3 (#1467)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-22 13:41:13 -06:00
tj-actions[bot]
e8f12786b4 Updated README.md (#1466)
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
2023-08-21 22:42:43 -06:00
Tonye Jack
8789204f97 feat: add support for including matching changed files when dir_names is set to true (#1464)
Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-08-22 03:11:59 +00:00
Tonye Jack
819fb64520 chore: update .eslintrc.json (#1465) 2023-08-21 16:11:26 -06:00
renovate[bot]
31003b45e6 chore(deps): update typescript-eslint monorepo to v6.4.1 (#1463)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 19:33:34 +00:00
renovate[bot]
1f04b16682 chore(deps): update dependency jest to v29.6.3 (#1462)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 16:43:07 +00:00
renovate[bot]
0a8b04e3e3 chore(deps): lock file maintenance (#1461)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-08-21 01:48:26 +00:00
Tonye Jack
f8b4039d96 Update README.md 2023-08-18 19:52:10 -06:00
renovate[bot]
6da496e2f9 chore(deps): update dependency @types/node to v20.5.1 (#1460)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-18 19:53:36 +00:00
renovate[bot]
68d38a3f16 chore(deps): update actions/setup-node action to v3.8.1 (#1459)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-17 17:55:12 +00:00
Tonye Jack
0e8eddfd8c Update README.md 2023-08-16 19:09:51 -06:00
tj-actions[bot]
3645cf9fc3 Upgraded to v37.6.1 (#1458)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-16 16:45:15 +00:00
renovate[bot]
a0585ff990 chore(deps): update dependency prettier to v3.0.2 (#1457)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-08-15 17:37:46 +00:00
renovate[bot]
ec3a2a3b3b chore(deps): update typescript-eslint monorepo to v6.4.0 (#1456)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-14 19:38:44 +00:00
renovate[bot]
24e2a6fb86 chore(deps): update actions/setup-node action to v3.8.0 (#1455)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-14 13:22:55 +00:00
renovate[bot]
1144bc6587 chore(deps): lock file maintenance (#1454)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-14 02:32:29 +00:00
renovate[bot]
fa84d9471e chore(deps): update dependency @types/node to v20.5.0 (#1453)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-13 21:41:48 +00:00
renovate[bot]
71dfd0dc2e chore(deps): update dependency @types/node to v20.4.10 (#1452)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-11 20:07:54 +00:00
renovate[bot]
b941520afb chore(deps): update dependency eslint to v8.47.0 (#1451)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-11 17:39:21 +00:00
renovate[bot]
be110124f6 chore(deps): lock file maintenance (#1450)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-11 04:48:12 +00:00
Tonye Jack
927363397d Update README.md 2023-08-09 18:30:47 -06:00
renovate[bot]
9dc097cfe5 chore(deps): update dependency @types/lodash to v4.14.197 (#1446)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 23:12:12 +00:00
renovate[bot]
e3b0c8a681 chore(deps): update dependency @types/node to v20.4.9 (#1444)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-08 22:05:23 +00:00
Tonye Jack
a62be95af3 chore: fix typo 2023-08-08 10:15:34 -06:00
Tonye Jack
a2e707696a Update README.md 2023-08-08 10:14:26 -06:00
renovate[bot]
f267068b02 chore(deps): update typescript-eslint monorepo to v6.3.0 (#1442)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-07 18:34:07 +00:00
tj-actions[bot]
7f0849be06 Upgraded to v37.6.0 (#1441)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-07 06:28:07 +00:00
15 changed files with 1312 additions and 758 deletions

View File

@@ -1,4 +1,5 @@
dist/ dist/
lib/ lib/
node_modules/ node_modules/
jest.config.js jest.config.js
coverage/

View File

@@ -5,7 +5,8 @@
"github" "github"
], ],
"extends": [ "extends": [
"plugin:github/recommended" "plugin:github/recommended",
"plugin:prettier/recommended"
], ],
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {

View File

@@ -43,6 +43,8 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
files_changed: ${{ steps.changed_files.outputs.files_changed }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
@@ -51,7 +53,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Use Node.js 16.x - name: Use Node.js 16.x
uses: actions/setup-node@v3.7.0 uses: actions/setup-node@v3.8.1
with: with:
cache: 'yarn' cache: 'yarn'
node-version: '16.x' node-version: '16.x'
@@ -119,6 +121,7 @@ jobs:
name: Test with multiple repositories name: Test with multiple repositories
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
steps: steps:
- name: Checkout into dir1 - name: Checkout into dir1
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -192,7 +195,7 @@ jobs:
name: Test changed-files using since and until name: Test changed-files using since and until
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' if: github.event_name == 'push' && needs.build.outputs.files_changed != 'true'
steps: steps:
- name: Checkout branch - name: Checkout branch
@@ -250,6 +253,7 @@ jobs:
name: Test changed-files similar base and commit sha name: Test changed-files similar base and commit sha
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
steps: steps:
- name: Checkout branch - name: Checkout branch
@@ -287,6 +291,7 @@ jobs:
name: Test unset GITHUB_OUTPUT env name: Test unset GITHUB_OUTPUT env
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
steps: steps:
- name: Checkout branch - name: Checkout branch
@@ -317,6 +322,8 @@ jobs:
name: Test changed-files with limited commit history name: Test changed-files with limited commit history
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -354,7 +361,7 @@ jobs:
name: Test changed-files with pull request head ref name: Test changed-files with pull request head ref
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: github.event_name != 'push' if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true'
steps: steps:
- name: Checkout branch - name: Checkout branch
@@ -381,7 +388,7 @@ jobs:
name: Test changed-files with pull request without persist credentials name: Test changed-files with pull request without persist credentials
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: github.event_name != 'push' if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true'
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -415,6 +422,7 @@ jobs:
name: Test changed-files non existent base sha name: Test changed-files non existent base sha
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
steps: steps:
- name: Checkout branch - name: Checkout branch
@@ -468,6 +476,7 @@ jobs:
name: Test changed-files non existent sha name: Test changed-files non existent sha
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
steps: steps:
- name: Checkout branch - name: Checkout branch
@@ -521,7 +530,7 @@ jobs:
name: Test changed-files with REST API name: Test changed-files with REST API
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: github.event_name != 'push' if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true'
permissions: permissions:
pull-requests: read pull-requests: read
steps: steps:
@@ -553,6 +562,7 @@ jobs:
name: Test changed-files with submodule name: Test changed-files with submodule
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -595,6 +605,7 @@ jobs:
name: Test changed-files with yaml name: Test changed-files with yaml
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -646,6 +657,7 @@ jobs:
name: Test changed-files recover deleted file name: Test changed-files recover deleted file
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -799,11 +811,12 @@ jobs:
name: Test changed-files name: Test changed-files
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
needs: build needs: build
if: needs.build.outputs.files_changed != 'true'
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
matrix: matrix:
platform: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-11, windows-2022] platform: [ubuntu-latest, macos-latest, windows-latest]
fetch-depth: [0, 1, 2] fetch-depth: [0, 1, 2]
steps: steps:
@@ -920,13 +933,20 @@ jobs:
echo '${{ toJSON(steps.changed-files-dir-names-max-depth.outputs) }}' echo '${{ toJSON(steps.changed-files-dir-names-max-depth.outputs) }}'
shell: shell:
bash bash
- name: Check dir_names output - name: Check dir_names output on non windows platform
if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test/test2/test3')" if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test/test2/test3') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected to include (test/test2/test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})" echo "Invalid output: Expected to include (test/test2/test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Check dir_names output on windows platform
if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test\\test2\\test3') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected to not include (test\\test2\\test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})"
exit 1
shell:
bash
- name: Run changed-files with dir_names and dir_names_exclude_current_dir - name: Run changed-files with dir_names and dir_names_exclude_current_dir
id: changed-files-dir-names-exclude-root id: changed-files-dir-names-exclude-root
uses: ./ uses: ./
@@ -936,7 +956,7 @@ jobs:
fetch_depth: 60000 fetch_depth: 60000
dir_names: "true" dir_names: "true"
dir_names_exclude_current_dir: "true" dir_names_exclude_current_dir: "true"
dir_names_max_depth: "1" dir_names_max_depth: 1
- name: Show output - name: Show output
run: | run: |
echo '${{ toJSON(steps.changed-files-dir-names-exclude-root.outputs) }}' echo '${{ toJSON(steps.changed-files-dir-names-exclude-root.outputs) }}'
@@ -976,7 +996,7 @@ jobs:
base_sha: d1c0ee4 base_sha: d1c0ee4
sha: 4d04215 sha: 4d04215
fetch_depth: 60000 fetch_depth: 60000
dir_names: "true" dir_names: true
files: test/** files: test/**
- name: Show output - name: Show output
run: | run: |
@@ -984,12 +1004,50 @@ jobs:
shell: shell:
bash bash
- name: Check dir_names output - name: Check dir_names output
if: steps.changed-files-dir-names.outputs.all_changed_files != 'test' if: steps.changed-files-dir-names-specific.outputs.all_changed_files != 'test'
run: | run: |
echo "Invalid output: Expected (test) got (${{ steps.changed-files-dir-names-specific.outputs.all_changed_files }})" echo "Invalid output: Expected (test) got (${{ steps.changed-files-dir-names-specific.outputs.all_changed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Run changed-files with dir_names and dir_names_include_files with specific files
id: changed-files-dir-names-specific-include-files
uses: ./
with:
base_sha: d1c0ee4
sha: 4d04215
fetch_depth: 60000
dir_names: true
dir_names_include_files: test/*.txt
files: test/**
json: true
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-dir-names-specific-include-files.outputs) }}'
shell:
bash
- name: Check dir_names output on non windows platform
if: |
(
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test/test rename-1.txt') ||
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test')
) && runner.os != 'Windows'
run: |
echo "Invalid output: Expected to include (test/test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})"
exit 1
shell:
bash
- name: Check dir_names output on windows platform
if: |
(
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test\\test rename-1.txt') ||
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test')
) && runner.os == 'Windows'
run: |
echo "Invalid output: Expected to include (test\\test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})"
exit 1
shell:
bash
- name: Run changed-files with forward slash separator - name: Run changed-files with forward slash separator
id: changed-files-forward-slash id: changed-files-forward-slash
uses: ./ uses: ./
@@ -1087,20 +1145,34 @@ jobs:
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-1.outputs) }}' echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-1.outputs) }}'
shell: shell:
bash bash
- name: Check all_old_new_renamed_files output - name: Check all_old_new_renamed_files output on non windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt')" if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected to include (test/test rename 1.txt,test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})" echo "Invalid output: Expected to include (test/test rename 1.txt,test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Check the renamed_files output - name: Check all_old_new_renamed_files output on windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt')" if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test\\test rename 1.txt,test\\test rename-1.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected to not include (test\\test rename 1.txt,test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})"
exit 1
shell:
bash
- name: Check the renamed_files output on non windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected to include (test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})" echo "Invalid output: Expected to include (test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Check the renamed_files output on windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test\\test rename-1.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected to not include (test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})"
exit 1
shell:
bash
- name: Run changed-files for old new filenames test rename 2 - name: Run changed-files for old new filenames test rename 2
id: changed-files-all-old-new-renamed-files-2 id: changed-files-all-old-new-renamed-files-2
uses: ./ uses: ./
@@ -1114,20 +1186,34 @@ jobs:
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2.outputs) }}' echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2.outputs) }}'
shell: shell:
bash bash
- name: Check all_old_new_renamed_files output - name: Check all_old_new_renamed_files output on non windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt')" if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})" echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Check the renamed_files output - name: Check all_old_new_renamed_files output on windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt')" if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test\\test rename 2.txt,test\\test rename-2.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected to not include (test\\test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})"
exit 1
shell:
bash
- name: Check the renamed_files output on non windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})" echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Check the renamed_files output on windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test\\test rename-2.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected to not include (test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})"
exit 1
shell:
bash
- name: Run changed-files for old new filenames test rename 2 output as deleted and added - name: Run changed-files for old new filenames test rename 2 output as deleted and added
id: changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added id: changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added
uses: ./ uses: ./
@@ -1142,27 +1228,48 @@ jobs:
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs) }}' echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs) }}'
shell: shell:
bash bash
- name: Check all_old_new_renamed_files output - name: Check all_old_new_renamed_files output on non windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt')" if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})" echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Check deleted_files output - name: Check all_old_new_renamed_files output on windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test/test rename 2.txt')" if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test\\test rename 2.txt,test\\test rename-2.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected to not include (test\\test rename 2.txt test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})"
exit 1
shell:
bash
- name: Check deleted_files output on non windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test/test rename 2.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected to include (test/test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})" echo "Invalid output: Expected to include (test/test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Check added_files output - name: Check deleted_files output on windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test/test rename-2.txt')" if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test\\test rename 2.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected to not include (test\\test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})"
exit 1
shell:
bash
- name: Check added_files output on non windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test/test rename-2.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})" echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Check added_files output on windows platform
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test\\test rename-2.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected to not include (test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})"
exit 1
shell:
bash
- name: Run changed-files with specific files - name: Run changed-files with specific files
id: changed-files-specific id: changed-files-specific
uses: ./ uses: ./
@@ -1178,15 +1285,22 @@ jobs:
echo '${{ toJSON(steps.changed-files-specific.outputs) }}' echo '${{ toJSON(steps.changed-files-specific.outputs) }}'
shell: shell:
bash bash
- name: Check if a excluded file is not included in any_changed - name: Check if a excluded file is not included in any_changed on non windows platform
if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test/test.txt')" if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test/test.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_changed_files }})" echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_changed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Verify any_changed for specific files - name: Check if a excluded file is not included in any_changed on windows platform
if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test.txt')" if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific.outputs.all_changed_files }})"
exit 1
shell:
bash
- name: Verify any_changed for specific files on non windows platform
if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test.txt') && runner.os != 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})"
@@ -1194,15 +1308,31 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Check if a excluded file is not included in any_modified - name: Verify any_changed for specific files on windows platform
if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test/test.txt')" if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github\\workflows\\test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test\\test.txt') && runner.os == 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})"
exit 1
fi
shell:
bash
- name: Check if a excluded file is not included in any_modified on non windows platform
if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test/test.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_modified_files }})" echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_modified_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Verify any_modified for specific files - name: Check if a excluded file is not included in any_modified on windows platform
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test.txt')" if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific.outputs.all_modified_files }})"
exit 1
shell:
bash
- name: Verify any_modified for specific files on non windows platform
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test.txt') && runner.os != 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})"
@@ -1210,15 +1340,40 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Check if a excluded file is not included in any_deleted - name: Verify any_modified for specific files on windows platform
if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test/test/test.txt')" if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github\\workflows\\test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test\\test.txt') && runner.os == 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})"
exit 1
fi
shell:
bash
- name: Check if a excluded file is not included in any_deleted on non windows platform
if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test/test/test.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.deleted_files }})" echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.deleted_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Verify any_deleted for specific files - name: Check if a excluded file is not included in any_deleted on windows platform
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test/test.txt')" if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific.outputs.deleted_files }})"
exit 1
shell:
bash
- name: Verify any_deleted for specific files on non windows platform
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test/test.txt') && runner.os != 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_deleted }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted for specific files on windows platform
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github\\workflows\\test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test\\test.txt') && runner.os == 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_deleted }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_deleted }})"
@@ -1282,8 +1437,8 @@ jobs:
echo '${{ toJSON(steps.changed-files-specific-comma.outputs) }}' echo '${{ toJSON(steps.changed-files-specific-comma.outputs) }}'
shell: shell:
bash bash
- name: Verify any_changed files comma separator - name: Verify any_changed files comma separator on non windows platform
if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github/workflows/test.yml')" if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific-comma.outputs.any_changed }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-comma.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_changed }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_changed }})"
@@ -1291,8 +1446,17 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Verify any_modified files comma separator - name: Verify any_changed files comma separator on windows platform
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github/workflows/test.yml')" if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific-comma.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_changed }})"
exit 1
fi
shell:
bash
- name: Verify any_modified files comma separator on non windows platform
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})"
@@ -1300,8 +1464,26 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Verify any_deleted files comma separator - name: Verify any_modified files comma separator on windows platform
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github/workflows/test.yml')" if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted files comma separator on non windows platform
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific-comma.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_deleted }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted files comma separator on windows platform
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific-comma.outputs.any_deleted }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-comma.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_deleted }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_deleted }})"
@@ -1322,8 +1504,8 @@ jobs:
echo '${{ toJSON(steps.changed-files-specific-pipe.outputs) }}' echo '${{ toJSON(steps.changed-files-specific-pipe.outputs) }}'
shell: shell:
bash bash
- name: Verify any_changed files comma separator - name: Verify any_changed files comma separator on non windows platform
if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github/workflows/test.yml')" if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_changed }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-pipe.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_changed }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_changed }})"
@@ -1331,8 +1513,17 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Verify any_modified files comma separator - name: Verify any_changed files comma separator on windows platform
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github/workflows/test.yml')" if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_changed }})"
exit 1
fi
shell:
bash
- name: Verify any_modified files comma separator on non windows platform
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})"
@@ -1340,8 +1531,26 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Verify any_deleted files comma separator - name: Verify any_modified files comma separator on windows platform
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github/workflows/test.yml')" if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted files comma separator on non windows platform
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_deleted }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted files comma separator on windows platform
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_deleted }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-pipe.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_deleted }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_deleted }})"
@@ -1362,8 +1571,8 @@ jobs:
echo '${{ toJSON(steps.changed-files-specific-forward-slash.outputs) }}' echo '${{ toJSON(steps.changed-files-specific-forward-slash.outputs) }}'
shell: shell:
bash bash
- name: Verify any_changed files forward slash separator - name: Verify any_changed files forward slash separator on non windows platform
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github/workflows/test.yml')" if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_changed }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_changed }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_changed }})"
@@ -1371,8 +1580,17 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Verify any_modified files forward slash separator - name: Verify any_changed files forward slash separator on windows platform
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github/workflows/test.yml')" if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_changed }})"
exit 1
fi
shell:
bash
- name: Verify any_modified files forward slash separator on non windows platform
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_modified }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})"
@@ -1380,8 +1598,26 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Verify any_deleted files forward slash separator - name: Verify any_modified files forward slash separator on windows platform
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github/workflows/test.yml')" if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted files forward slash separator on non windows platform
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
run: |
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted files forward slash separator on windows platform
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
run: | run: |
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }})"
@@ -1398,14 +1634,26 @@ jobs:
test/changed-files-list.txt test/changed-files-list.txt
files: | files: |
**/workflows/greetings.yml **/workflows/greetings.yml
- name: Check if a excluded file is not included in any_changed - name: Show output
if: contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test/test.txt') run: |
echo '${{ toJSON(steps.changed-files-specific-source-file.outputs) }}'
shell:
bash
- name: Check if a excluded file is not included in any_changed on non windows platform
if: "contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test/test.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_changed_files }})" echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_changed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Verify any_changed from source files - name: Check if a excluded file is not included in any_changed on windows platform
if: "contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_changed_files }})"
exit 1
shell:
bash
- name: Verify any_changed from source files on non windows platform
if: | if: |
( (
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'action.yml') &&
@@ -1414,7 +1662,8 @@ jobs:
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test.txt') && !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') && !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '[test new].txt') && !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '[test new].txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml') !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml') &&
runner.os != 'Windows'
) )
run: | run: |
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_changed }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-source-file.outputs.any_changed }}" != "false" ]]; then
@@ -1423,14 +1672,21 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Check if a excluded file is not included in any_modified - name: Check if a excluded file is not included in any_modified on non windows platform
if: contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test/test.txt') if: "contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test/test.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_modified_files }})" echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_modified_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Verify any_modified from source files - name: Check if a excluded file is not included in any_modified on windows platform
if: "contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
run: |
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_modified_files }})"
exit 1
shell:
bash
- name: Verify any_modified from source files on non windows platform
if: | if: |
( (
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'action.yml') &&
@@ -1439,7 +1695,8 @@ jobs:
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test.txt') && !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') && !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '[test new].txt') && !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '[test new].txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml') !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml') &&
runner.os != 'Windows'
) )
run: | run: |
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_modified }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-source-file.outputs.any_modified }}" != "false" ]]; then
@@ -1448,14 +1705,21 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Check if a excluded file is not included in any_deleted - name: Check if a excluded file is not included in any_deleted on non windows platform
if: contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test/test.txt') if: "contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test/test.txt') && runner.os != 'Windows'"
run: | run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.deleted_files }})" echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.deleted_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Verify any_deleted from source files - name: Check if a excluded file is not included in any_deleted on windows platform
if: contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test\\test\\test.txt')
run: |
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific-source-file.outputs.deleted_files }})"
exit 1
shell:
bash
- name: Verify any_deleted from source files on non windows platform
if: | if: |
( (
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'action.yml') &&
@@ -1464,7 +1728,8 @@ jobs:
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test.txt') && !contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') && !contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '[test new].txt') && !contains(steps.changed-files-specific-source-file.outputs.deleted_files, '[test new].txt') &&
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/greetings.yml') !contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/greetings.yml') &&
runner.os != 'Windows'
) )
run: | run: |
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_deleted }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-source-file.outputs.any_deleted }}" != "false" ]]; then
@@ -1490,7 +1755,7 @@ jobs:
echo '${{ toJSON(steps.changed-files-specific-comma-source-file.outputs) }}' echo '${{ toJSON(steps.changed-files-specific-comma-source-file.outputs) }}'
shell: shell:
bash bash
- name: Verify any_changed files comma separator - name: Verify any_changed files comma separator from source files on non windows platform
if: | if: |
( (
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'action.yml') &&
@@ -1498,7 +1763,8 @@ jobs:
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test.txt') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test.txt') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '[test new].txt') !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '[test new].txt') &&
runner.os != 'Windows'
) )
run: | run: |
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }}" != "false" ]]; then
@@ -1507,7 +1773,7 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Verify any_modified files comma separator - name: Verify any_modified files comma separator from source files on non windows platform
if: | if: |
( (
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'action.yml') &&
@@ -1515,7 +1781,8 @@ jobs:
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test.txt') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test.txt') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '[test new].txt') !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '[test new].txt') &&
runner.os != 'Windows'
) )
run: | run: |
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }}" != "false" ]]; then
@@ -1524,23 +1791,6 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Verify any_deleted files with comma separator
if: |
(
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'action.yml') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '.github/workflows/test.yml') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '[test new].txt')
)
run: |
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }})"
exit 1
fi
shell:
bash
- name: Get branch name - name: Get branch name
id: branch-name id: branch-name
uses: tj-actions/branch-names@v7 uses: tj-actions/branch-names@v7

View File

@@ -1,5 +1,70 @@
# Changelog # Changelog
# [37.6.1](https://github.com/tj-actions/changed-files/compare/v37.6.0...v37.6.1) - (2023-08-15)
## <!-- 26 -->🔄 Update
- Update README.md ([9273633](https://github.com/tj-actions/changed-files/commit/927363397d870aec841c3616c5136442218239af)) - (Tonye Jack)
- Update README.md ([a2e7076](https://github.com/tj-actions/changed-files/commit/a2e707696afd3f2f1738328cbfed71c56cd9b744)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update dependency prettier to v3.0.2 ([#1457](https://github.com/tj-actions/changed-files/issues/1457)) ([a0585ff](https://github.com/tj-actions/changed-files/commit/a0585ff9904b77d046192a7846e59783d6ea287b)) - (renovate[bot])
- **deps:** Update typescript-eslint monorepo to v6.4.0 ([#1456](https://github.com/tj-actions/changed-files/issues/1456)) ([ec3a2a3](https://github.com/tj-actions/changed-files/commit/ec3a2a3b3bf9648f952a5c642013948f99ab154f)) - (renovate[bot])
- **deps:** Update actions/setup-node action to v3.8.0 ([#1455](https://github.com/tj-actions/changed-files/issues/1455)) ([24e2a6f](https://github.com/tj-actions/changed-files/commit/24e2a6fb86042fb1e67a527045d6f8dea53b7d06)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1454](https://github.com/tj-actions/changed-files/issues/1454)) ([1144bc6](https://github.com/tj-actions/changed-files/commit/1144bc6587e8570446c99b3cd5961539c750de3e)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.0 ([#1453](https://github.com/tj-actions/changed-files/issues/1453)) ([fa84d94](https://github.com/tj-actions/changed-files/commit/fa84d9471e31552ac5031e74416776d80f7b3c23)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.4.10 ([#1452](https://github.com/tj-actions/changed-files/issues/1452)) ([71dfd0d](https://github.com/tj-actions/changed-files/commit/71dfd0dc2e7cde599586ee53148fcf31fda68499)) - (renovate[bot])
- **deps:** Update dependency eslint to v8.47.0 ([#1451](https://github.com/tj-actions/changed-files/issues/1451)) ([b941520](https://github.com/tj-actions/changed-files/commit/b941520afb05ff090564ee87734ece045963aaa7)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1450](https://github.com/tj-actions/changed-files/issues/1450)) ([be11012](https://github.com/tj-actions/changed-files/commit/be110124f6253e3471e3c0280329c359fef9b077)) - (renovate[bot])
- **deps:** Update dependency @types/lodash to v4.14.197 ([#1446](https://github.com/tj-actions/changed-files/issues/1446)) ([9dc097c](https://github.com/tj-actions/changed-files/commit/9dc097cfe56dd6dca442b8b71b988aad4c385f94)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.4.9 ([#1444](https://github.com/tj-actions/changed-files/issues/1444)) ([e3b0c8a](https://github.com/tj-actions/changed-files/commit/e3b0c8a681e6f809136066ceeaae9a9203eddf29)) - (renovate[bot])
- Fix typo ([a62be95](https://github.com/tj-actions/changed-files/commit/a62be95af39e3e8d28a0ff4a80d07d30e7d16e17)) - (Tonye Jack)
- **deps:** Update typescript-eslint monorepo to v6.3.0 ([#1442](https://github.com/tj-actions/changed-files/issues/1442)) ([f267068](https://github.com/tj-actions/changed-files/commit/f267068b025785a2b8e6c5fd692c18782759af31)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v37.6.0 ([#1441](https://github.com/tj-actions/changed-files/issues/1441))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([7f0849b](https://github.com/tj-actions/changed-files/commit/7f0849be06042444c62445709a000389e08d70e6)) - (tj-actions[bot])
# [37.6.0](https://github.com/tj-actions/changed-files/compare/v37.5.2...v37.6.0) - (2023-08-07)
## <!-- 0 -->🚀 Features
- Improve checking local branch history ([#1436](https://github.com/tj-actions/changed-files/issues/1436)) ([d4e6e22](https://github.com/tj-actions/changed-files/commit/d4e6e22e932832260459e972c83fa76adca04a5c)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Update README.md ([1e9cd5f](https://github.com/tj-actions/changed-files/commit/1e9cd5f2990496e3dc049d7978a807ed153b11a7)) - (Tonye Jack)
- Update README.md ([6b028b6](https://github.com/tj-actions/changed-files/commit/6b028b63039ee69ccfad97e35166eb997f6807ff)) - (Tonye Jack)
- Updated README.md ([#1432](https://github.com/tj-actions/changed-files/issues/1432))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([b61db78](https://github.com/tj-actions/changed-files/commit/b61db7817fbdc9f587fb205f4276886cda5913c5)) - (tj-actions[bot])
- Update README.md ([6a48a0a](https://github.com/tj-actions/changed-files/commit/6a48a0a0182db1daa7e00603ede7e99364f65ff2)) - (Tonye Jack)
- Update README.md ([3415802](https://github.com/tj-actions/changed-files/commit/3415802ae92f45865a7bb5f80578ad22994f57ea)) - (Tonye Jack)
- Update README.md ([20a19b9](https://github.com/tj-actions/changed-files/commit/20a19b977fa3a78c7d87956e7b388681926d3b56)) - (Tonye Jack)
- Update README.md ([10228bf](https://github.com/tj-actions/changed-files/commit/10228bf07b9286b8db198de83022b52ab908bde7)) - (Tonye Jack)
## <!-- 6 -->🧪 Testing
- Improve test coverage ([#1435](https://github.com/tj-actions/changed-files/issues/1435)) ([29022e8](https://github.com/tj-actions/changed-files/commit/29022e81a423492ed68172112181d0109be5e64e)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Improve test coverage ([#1440](https://github.com/tj-actions/changed-files/issues/1440)) ([87697c0](https://github.com/tj-actions/changed-files/commit/87697c0dca7dd44e37a2b79a79489332556ff1f3)) - (Tonye Jack)
- Simplify code ([#1439](https://github.com/tj-actions/changed-files/issues/1439)) ([0acc1c3](https://github.com/tj-actions/changed-files/commit/0acc1c308efedeb1a3a82d4c3812e380cacc86ec)) - (Tonye Jack)
- **deps:** Lock file maintenance ([#1438](https://github.com/tj-actions/changed-files/issues/1438)) ([312a3d8](https://github.com/tj-actions/changed-files/commit/312a3d8003811361254cc82903f9a5e057bd1d66)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.4.8 ([#1425](https://github.com/tj-actions/changed-files/issues/1425)) ([701bae5](https://github.com/tj-actions/changed-files/commit/701bae514b676a5deb33f611a66c7639c3ee2690)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1437](https://github.com/tj-actions/changed-files/issues/1437)) ([8bffb97](https://github.com/tj-actions/changed-files/commit/8bffb974e49dd3c5f242d8af10b9326194c99740)) - (renovate[bot])
- **deps-dev:** Bump @types/node from 20.4.6 to 20.4.7 ([#1433](https://github.com/tj-actions/changed-files/issues/1433)) ([f762082](https://github.com/tj-actions/changed-files/commit/f76208237d15a696b0174f93dbb00254bc016c65)) - (dependabot[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v37.5.2 ([#1431](https://github.com/tj-actions/changed-files/issues/1431))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([24ac45c](https://github.com/tj-actions/changed-files/commit/24ac45c74eee7f284e92f053e045dd94823f7255)) - (tj-actions[bot])
# [37.5.2](https://github.com/tj-actions/changed-files/compare/v37.5.1...v37.5.2) - (2023-08-03) # [37.5.2](https://github.com/tj-actions/changed-files/compare/v37.5.1...v37.5.2) - (2023-08-03)
## <!-- 26 -->🔄 Update ## <!-- 26 -->🔄 Update

View File

@@ -44,8 +44,8 @@ Effortlessly track all changed files and directories relative to a target branch
* Facilitates easy debugging. * Facilitates easy debugging.
* Scales to handle large repositories. * Scales to handle large repositories.
* Supports Git submodules. * Supports Git submodules.
* Supports [merge queues](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue) for pull reequests. * Supports [merge queues](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue) for pull requests.
* Generates escaped JSON output for running matrix jobs based on changed files. * Generates escaped [JSON output for running matrix jobs](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-test.yml) based on changed files.
* Lists changed directories. * Lists changed directories.
* Limits matching changed directories to a specified maximum depth. * Limits matching changed directories to a specified maximum depth.
* Optionally excludes the current directory. * Optionally excludes the current directory.
@@ -74,7 +74,7 @@ And many more...
## Usage ## Usage
> **Warning**: > **Warning**
> >
> * For `push` events: When configuring [`actions/checkout`](https://github.com/actions/checkout#usage), make sure to set [`fetch-depth`](https://github.com/actions/checkout#usage) to either `0` or `2`, depending on your use case. > * For `push` events: When configuring [`actions/checkout`](https://github.com/actions/checkout#usage), make sure to set [`fetch-depth`](https://github.com/actions/checkout#usage) to either `0` or `2`, depending on your use case.
> * For mono repositories where pulling all branch history might not be desired, you can still use the default [`fetch-depth`](https://github.com/actions/checkout#usage), which is set to `1` for `pull_request` events. > * For mono repositories where pulling all branch history might not be desired, you can still use the default [`fetch-depth`](https://github.com/actions/checkout#usage), which is set to `1` for `pull_request` events.
@@ -126,7 +126,7 @@ jobs:
# Optionally set `files_yaml_from_source_file` to read the YAML from a file. e.g `files_yaml_from_source_file: .github/changed-files.yml` # Optionally set `files_yaml_from_source_file` to read the YAML from a file. e.g `files_yaml_from_source_file: .github/changed-files.yml`
- name: Run step if test file(s) change - name: Run step if test file(s) change
# NOTE: The key has to start with the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output. # NOTE: Ensure all outputs are prefixed by the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output.
if: steps.changed-files-yaml.outputs.test_any_changed == 'true' if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
run: | run: |
echo "One or more test file(s) has changed." echo "One or more test file(s) has changed."
@@ -230,6 +230,8 @@ on:
# tags: # tags:
# - '**' # - '**'
# #
# merge_group:
#
# ...and many more # ...and many more
@@ -296,7 +298,7 @@ Support this project with a :star:
| U | Unmerged | | U | Unmerged |
| X | Unknown | | X | Unknown |
> **Warning**: > **Warning**
> >
> * When using `files_yaml*` inputs ensure all outputs are prefixed by the key `test_{...}` e.g. `test_added_files`, `test_any_changed` > * When using `files_yaml*` inputs ensure all outputs are prefixed by the key `test_{...}` e.g. `test_added_files`, `test_any_changed`
@@ -356,6 +358,8 @@ Support this project with a :star:
| diff\_relative | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. | | diff\_relative | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. |
| dir\_names | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the current working directory <br>which defaults to `$GITHUB_WORKSPACE`. | | dir\_names | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the current working directory <br>which defaults to `$GITHUB_WORKSPACE`. |
| dir\_names\_exclude\_current\_dir | string | false | `"false"` | Exclude the current directory represented <br>by `.` from the output <br>when `dir_names` is set to <br>`true`. | | dir\_names\_exclude\_current\_dir | string | false | `"false"` | Exclude the current directory represented <br>by `.` from the output <br>when `dir_names` is set to <br>`true`. |
| dir\_names\_include\_files | string | false | | Include files in the output <br>when `dir_names` is set to <br>`true`. **NOTE:** This returns only <br>the matching files and also <br>the directory names. |
| dir\_names\_include\_files\_separator | string | false | `"\n"` | Separator used to split the <br>`dir_names_include_files` input |
| dir\_names\_max\_depth | string | false | | Limit the directory output to <br>a maximum depth e.g `test/test1/test2` <br>with max depth of `2` <br>returns `test/test1`. | | dir\_names\_max\_depth | string | false | | Limit the directory output to <br>a maximum depth e.g `test/test1/test2` <br>with max depth of `2` <br>returns `test/test1`. |
| escape\_json | string | false | `"true"` | Escape JSON output. | | escape\_json | string | false | `"true"` | Escape JSON output. |
| fetch\_depth | string | false | `"50"` | Depth of additional branch history <br>fetched. **NOTE**: This can be <br>adjusted to resolve errors with <br>insufficient history. | | fetch\_depth | string | false | `"50"` | Depth of additional branch history <br>fetched. **NOTE**: This can be <br>adjusted to resolve errors with <br>insufficient history. |
@@ -820,7 +824,7 @@ See [inputs](#inputs) for more information.
</li> </li>
</ul> </ul>
> **Warning**: > **Warning**
> >
> This setting overrides the commit sha used by setting `since_last_remote_commit` to true. > This setting overrides the commit sha used by setting `since_last_remote_commit` to true.
> It is recommended to use either solution that works for your use case. > It is recommended to use either solution that works for your use case.
@@ -910,7 +914,7 @@ And many more...
## Known Limitation ## Known Limitation
> **Warning**: > **Warning**
> >
> * Spaces in file names can introduce bugs when using bash loops. See: [#216](https://github.com/tj-actions/changed-files/issues/216) > * Spaces in file names can introduce bugs when using bash loops. See: [#216](https://github.com/tj-actions/changed-files/issues/216)
> However, this action will handle spaces in file names, with a recommendation of using a separator to prevent any hidden issues. > However, this action will handle spaces in file names, with a recommendation of using a separator to prevent any hidden issues.

View File

@@ -112,6 +112,14 @@ inputs:
description: "Exclude the current directory represented by `.` from the output when `dir_names` is set to `true`." description: "Exclude the current directory represented by `.` from the output when `dir_names` is set to `true`."
required: false required: false
default: "false" default: "false"
dir_names_include_files:
description: "Include files in the output when `dir_names` is set to `true`. **NOTE:** This returns only the matching files and also the directory names."
required: false
default: ""
dir_names_include_files_separator:
description: "Separator used to split the `dir_names_include_files` input"
default: "\n"
required: false
json: json:
description: "Output list of changed files in a JSON formatted string which can be used for matrix jobs." description: "Output list of changed files in a JSON formatted string which can be used for matrix jobs."
required: false required: false

156
dist/index.js generated vendored
View File

@@ -53,6 +53,7 @@ exports.getChangedFilesFromGithubAPI = exports.getAllChangeTypeFiles = exports.g
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438)); const github = __importStar(__nccwpck_require__(5438));
const flatten_1 = __importDefault(__nccwpck_require__(2394)); const flatten_1 = __importDefault(__nccwpck_require__(2394));
const micromatch_1 = __importDefault(__nccwpck_require__(6228));
const path = __importStar(__nccwpck_require__(1017)); const path = __importStar(__nccwpck_require__(1017));
const utils_1 = __nccwpck_require__(918); const utils_1 = __nccwpck_require__(918);
const getRenamedFiles = ({ inputs, workingDirectory, hasSubmodule, diffResult, submodulePaths }) => __awaiter(void 0, void 0, void 0, function* () { const getRenamedFiles = ({ inputs, workingDirectory, hasSubmodule, diffResult, submodulePaths }) => __awaiter(void 0, void 0, void 0, function* () {
@@ -74,11 +75,20 @@ const getRenamedFiles = ({ inputs, workingDirectory, hasSubmodule, diffResult, s
}); });
const submoduleWorkingDirectory = path.join(workingDirectory, submodulePath); const submoduleWorkingDirectory = path.join(workingDirectory, submodulePath);
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) { if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
let diff = '...';
if (!(yield (0, utils_1.canDiffCommits)({
cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha,
diff
}))) {
diff = '..';
}
const submoduleRenamedFiles = yield (0, utils_1.gitRenamedFiles)({ const submoduleRenamedFiles = yield (0, utils_1.gitRenamedFiles)({
cwd: submoduleWorkingDirectory, cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha, sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha, sha2: submoduleShaResult.currentSha,
diff: diffResult.diff, diff,
oldNewSeparator: inputs.oldNewSeparator, oldNewSeparator: inputs.oldNewSeparator,
isSubmodule: true, isSubmodule: true,
parentDir: submodulePath parentDir: submodulePath
@@ -129,11 +139,20 @@ const getAllDiffFiles = ({ workingDirectory, hasSubmodule, diffResult, submodule
}); });
const submoduleWorkingDirectory = path.join(workingDirectory, submodulePath); const submoduleWorkingDirectory = path.join(workingDirectory, submodulePath);
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) { if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
let diff = '...';
if (!(yield (0, utils_1.canDiffCommits)({
cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha,
diff
}))) {
diff = '..';
}
const submoduleFiles = yield (0, utils_1.getAllChangedFiles)({ const submoduleFiles = yield (0, utils_1.getAllChangedFiles)({
cwd: submoduleWorkingDirectory, cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha, sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha, sha2: submoduleShaResult.currentSha,
diff: diffResult.diff, diff,
isSubmodule: true, isSubmodule: true,
parentDir: submodulePath, parentDir: submodulePath,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded
@@ -150,20 +169,38 @@ const getAllDiffFiles = ({ workingDirectory, hasSubmodule, diffResult, submodule
return files; return files;
}); });
exports.getAllDiffFiles = getAllDiffFiles; exports.getAllDiffFiles = getAllDiffFiles;
function* getFilePaths({ inputs, filePaths, dirNamesIncludeFilePatterns }) {
for (const filePath of filePaths) {
if (inputs.dirNames) {
if (dirNamesIncludeFilePatterns.length > 0) {
const isWin = (0, utils_1.isWindows)();
const matchOptions = { dot: true, windows: isWin, noext: true };
if (micromatch_1.default.isMatch(filePath, dirNamesIncludeFilePatterns, matchOptions)) {
yield filePath;
}
}
yield (0, utils_1.getDirnameMaxDepth)({
relativePath: filePath,
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
});
}
else {
yield filePath;
}
}
}
function* getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes }) { function* getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes }) {
const dirNamesIncludeFilePatterns = (0, utils_1.getDirNamesIncludeFilesPattern)({ inputs });
core.debug(`Dir names include file patterns: ${JSON.stringify(dirNamesIncludeFilePatterns)}`);
for (const changeType of changeTypes) { for (const changeType of changeTypes) {
const files = changedFiles[changeType] || []; const filePaths = changedFiles[changeType] || [];
for (const filePath of files) { for (const filePath of getFilePaths({
if (inputs.dirNames) { inputs,
yield (0, utils_1.getDirnameMaxDepth)({ filePaths,
relativePath: filePath, dirNamesIncludeFilePatterns
dirNamesMaxDepth: inputs.dirNamesMaxDepth, })) {
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir yield filePath;
});
}
else {
yield filePath;
}
} }
} }
} }
@@ -184,17 +221,15 @@ const getChangeTypeFiles = ({ inputs, changedFiles, changeTypes }) => __awaiter(
}); });
exports.getChangeTypeFiles = getChangeTypeFiles; exports.getChangeTypeFiles = getChangeTypeFiles;
function* getAllChangeTypeFilesGenerator({ inputs, changedFiles }) { function* getAllChangeTypeFilesGenerator({ inputs, changedFiles }) {
for (const filePath of (0, flatten_1.default)(Object.values(changedFiles))) { const dirNamesIncludeFilePatterns = (0, utils_1.getDirNamesIncludeFilesPattern)({ inputs });
if (inputs.dirNames) { core.debug(`Dir names include file patterns: ${JSON.stringify(dirNamesIncludeFilePatterns)}`);
yield (0, utils_1.getDirnameMaxDepth)({ const filePaths = (0, flatten_1.default)(Object.values(changedFiles));
relativePath: filePath, for (const filePath of getFilePaths({
dirNamesMaxDepth: inputs.dirNamesMaxDepth, inputs,
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir filePaths,
}); dirNamesIncludeFilePatterns
} })) {
else { yield filePath;
yield filePath;
}
} }
} }
const getAllChangeTypeFiles = ({ inputs, changedFiles }) => __awaiter(void 0, void 0, void 0, function* () { const getAllChangeTypeFiles = ({ inputs, changedFiles }) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1216,6 +1251,13 @@ const getInputs = () => {
const dirNamesExcludeCurrentDir = core.getBooleanInput('dir_names_exclude_current_dir', { const dirNamesExcludeCurrentDir = core.getBooleanInput('dir_names_exclude_current_dir', {
required: false required: false
}); });
const dirNamesIncludeFiles = core.getInput('dir_names_include_files', {
required: false
});
const dirNamesIncludeFilesSeparator = core.getInput('dir_names_include_files_separator', {
required: false,
trimWhitespace: false
});
const json = core.getBooleanInput('json', { required: false }); const json = core.getBooleanInput('json', { required: false });
const escapeJson = core.getBooleanInput('escape_json', { required: false }); const escapeJson = core.getBooleanInput('escape_json', { required: false });
const fetchDepth = core.getInput('fetch_depth', { required: false }); const fetchDepth = core.getInput('fetch_depth', { required: false });
@@ -1280,17 +1322,19 @@ const getInputs = () => {
includeAllOldNewRenamedFiles, includeAllOldNewRenamedFiles,
oldNewSeparator, oldNewSeparator,
oldNewFilesSeparator, oldNewFilesSeparator,
skipInitialFetch,
// End Not Supported via REST API // End Not Supported via REST API
dirNames, dirNames,
dirNamesExcludeCurrentDir, dirNamesExcludeCurrentDir,
dirNamesIncludeFiles,
dirNamesIncludeFilesSeparator,
json, json,
escapeJson, escapeJson,
writeOutputFiles, writeOutputFiles,
outputDir, outputDir,
outputRenamedFilesAsDeletedAndAdded, outputRenamedFilesAsDeletedAndAdded,
token, token,
apiUrl, apiUrl
skipInitialFetch
}; };
if (fetchDepth) { if (fetchDepth) {
inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2); inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2);
@@ -1549,7 +1593,10 @@ function run() {
'sinceLastRemoteCommit', 'sinceLastRemoteCommit',
'recoverDeletedFiles', 'recoverDeletedFiles',
'recoverDeletedFilesToDestination', 'recoverDeletedFilesToDestination',
'includeAllOldNewRenamedFiles' 'recoverFiles',
'recoverFilesIgnore',
'includeAllOldNewRenamedFiles',
'skipInitialFetch'
]; ];
for (const input of unsupportedInputs) { for (const input of unsupportedInputs) {
if (inputs[input]) { if (inputs[input]) {
@@ -1650,7 +1697,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.hasLocalGitDirectory = exports.recoverDeletedFiles = exports.setOutput = exports.getRecoverFilePatterns = exports.getYamlFilePatterns = exports.getFilePatterns = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.getRemoteBranchHeadSha = exports.isInsideWorkTree = exports.getHeadSha = exports.gitLog = exports.getFilteredChangedFiles = exports.getAllChangedFiles = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = exports.getDirname = exports.normalizeSeparators = exports.isWindows = void 0; exports.hasLocalGitDirectory = exports.recoverDeletedFiles = exports.setOutput = exports.getRecoverFilePatterns = exports.getYamlFilePatterns = exports.getFilePatterns = exports.getDirNamesIncludeFilesPattern = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.getRemoteBranchHeadSha = exports.isInsideWorkTree = exports.getHeadSha = exports.gitLog = exports.getFilteredChangedFiles = exports.getAllChangedFiles = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = exports.getDirname = exports.normalizeSeparators = exports.isWindows = void 0;
/*global AsyncIterableIterator*/ /*global AsyncIterableIterator*/
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514)); const exec = __importStar(__nccwpck_require__(1514));
@@ -1685,14 +1732,6 @@ const normalizeSeparators = (p) => {
return p.replace(/\/\/+/g, '/'); return p.replace(/\/\/+/g, '/');
}; };
exports.normalizeSeparators = normalizeSeparators; exports.normalizeSeparators = normalizeSeparators;
/**
* Normalize file path separators to '/' on all platforms
* @param p - file path
* @returns file path with normalized separators
*/
const normalizePath = (p) => {
return p.replace(/\\/g, '/');
};
/** /**
* Trims unnecessary trailing slash from file path * Trims unnecessary trailing slash from file path
* @param p - file path * @param p - file path
@@ -1953,7 +1992,7 @@ const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function
return stdout return stdout
.trim() .trim()
.split('\n') .split('\n')
.map((line) => normalizePath(line.trim().split(' ')[1])); .map((line) => (0, exports.normalizeSeparators)(line.trim().split(' ')[1]));
}); });
exports.getSubmodulePath = getSubmodulePath; exports.getSubmodulePath = getSubmodulePath;
/** /**
@@ -2014,9 +2053,9 @@ const gitRenamedFiles = ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule =
core.debug(`Renamed file: ${line}`); core.debug(`Renamed file: ${line}`);
const [, oldPath, newPath] = line.split('\t'); const [, oldPath, newPath] = line.split('\t');
if (isSubmodule) { if (isSubmodule) {
return `${normalizePath(path.join(parentDir, oldPath))}${oldNewSeparator}${normalizePath(path.join(parentDir, newPath))}`; return `${(0, exports.normalizeSeparators)(path.join(parentDir, oldPath))}${oldNewSeparator}${(0, exports.normalizeSeparators)(path.join(parentDir, newPath))}`;
} }
return `${normalizePath(oldPath)}${oldNewSeparator}${normalizePath(newPath)}`; return `${(0, exports.normalizeSeparators)(oldPath)}${oldNewSeparator}${(0, exports.normalizeSeparators)(newPath)}`;
}); });
}); });
exports.gitRenamedFiles = gitRenamedFiles; exports.gitRenamedFiles = gitRenamedFiles;
@@ -2067,11 +2106,11 @@ const getAllChangedFiles = ({ cwd, sha1, sha2, diff, isSubmodule = false, parent
for (const line of lines) { for (const line of lines) {
const [changeType, filePath, newPath = ''] = line.split('\t'); const [changeType, filePath, newPath = ''] = line.split('\t');
const normalizedFilePath = isSubmodule const normalizedFilePath = isSubmodule
? normalizePath(path.join(parentDir, filePath)) ? (0, exports.normalizeSeparators)(path.join(parentDir, filePath))
: normalizePath(filePath); : (0, exports.normalizeSeparators)(filePath);
const normalizedNewPath = isSubmodule const normalizedNewPath = isSubmodule
? normalizePath(path.join(parentDir, newPath)) ? (0, exports.normalizeSeparators)(path.join(parentDir, newPath))
: normalizePath(newPath); : (0, exports.normalizeSeparators)(newPath);
if (changeType.startsWith('R')) { if (changeType.startsWith('R')) {
if (outputRenamedFilesAsDeletedAndAdded) { if (outputRenamedFilesAsDeletedAndAdded) {
changedFiles[changedFiles_1.ChangeTypeEnum.Deleted].push(normalizedFilePath); changedFiles[changedFiles_1.ChangeTypeEnum.Deleted].push(normalizedFilePath);
@@ -2105,14 +2144,15 @@ const getFilteredChangedFiles = ({ allDiffFiles, filePatterns }) => __awaiter(vo
[changedFiles_1.ChangeTypeEnum.Unknown]: [] [changedFiles_1.ChangeTypeEnum.Unknown]: []
}; };
const hasFilePatterns = filePatterns.length > 0; const hasFilePatterns = filePatterns.length > 0;
const isWin = (0, exports.isWindows)();
for (const changeType of Object.keys(allDiffFiles)) { for (const changeType of Object.keys(allDiffFiles)) {
const files = allDiffFiles[changeType]; const files = allDiffFiles[changeType];
if (hasFilePatterns) { if (hasFilePatterns) {
changedFiles[changeType] = (0, micromatch_1.default)(files, filePatterns, { changedFiles[changeType] = (0, micromatch_1.default)(files, filePatterns, {
dot: true, dot: true,
windows: (0, exports.isWindows)(), windows: isWin,
noext: true noext: true
}); }).map(exports.normalizeSeparators);
} }
else { else {
changedFiles[changeType] = files; changedFiles[changeType] = files;
@@ -2187,7 +2227,7 @@ const verifyCommitSha = ({ sha, cwd, showAsErrorMessage = true }) => __awaiter(v
}); });
exports.verifyCommitSha = verifyCommitSha; exports.verifyCommitSha = verifyCommitSha;
const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () { const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
const { stdout } = yield exec.getExecOutput('git', ['tag', '--sort=-version:refname'], { const { stdout } = yield exec.getExecOutput('git', ['tag', '--sort=-creatordate'], {
cwd, cwd,
silent: !core.isDebug() silent: !core.isDebug()
}); });
@@ -2258,7 +2298,7 @@ const getDirnameMaxDepth = ({ relativePath, dirNamesMaxDepth, excludeCurrentDir
if (excludeCurrentDir && output === '.') { if (excludeCurrentDir && output === '.') {
return ''; return '';
} }
return normalizePath(output); return (0, exports.normalizeSeparators)(output);
}; };
exports.getDirnameMaxDepth = getDirnameMaxDepth; exports.getDirnameMaxDepth = getDirnameMaxDepth;
const jsonOutput = ({ value, shouldEscape }) => { const jsonOutput = ({ value, shouldEscape }) => {
@@ -2266,10 +2306,16 @@ const jsonOutput = ({ value, shouldEscape }) => {
return shouldEscape ? result.replace(/"/g, '\\"') : result; return shouldEscape ? result.replace(/"/g, '\\"') : result;
}; };
exports.jsonOutput = jsonOutput; exports.jsonOutput = jsonOutput;
const getDirNamesIncludeFilesPattern = ({ inputs }) => {
return inputs.dirNamesIncludeFiles
.split(inputs.dirNamesIncludeFilesSeparator)
.filter(Boolean);
};
exports.getDirNamesIncludeFilesPattern = getDirNamesIncludeFilesPattern;
const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0, void 0, function* () { const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0, void 0, function* () {
let filePatterns = inputs.files let filePatterns = inputs.files
.split(inputs.filesSeparator) .split(inputs.filesSeparator)
.filter(p => p !== '') .filter(Boolean)
.join('\n'); .join('\n');
if (inputs.filesFromSourceFile !== '') { if (inputs.filesFromSourceFile !== '') {
const inputFilesFromSourceFile = inputs.filesFromSourceFile const inputFilesFromSourceFile = inputs.filesFromSourceFile
@@ -2312,7 +2358,7 @@ const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void
filePatterns = filePatterns.replace(/\r\n/g, '\n'); filePatterns = filePatterns.replace(/\r\n/g, '\n');
filePatterns = filePatterns.replace(/\r/g, '\n'); filePatterns = filePatterns.replace(/\r/g, '\n');
} }
core.debug(`file patterns: ${filePatterns}`); core.debug(`Input file patterns: ${filePatterns}`);
return filePatterns return filePatterns
.trim() .trim()
.split('\n') .split('\n')
@@ -2322,10 +2368,10 @@ const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void
return `${pattern}**`; return `${pattern}**`;
} }
else { else {
const pathParts = pattern.split(path.sep); const pathParts = pattern.split('/');
const lastPart = pathParts[pathParts.length - 1]; const lastPart = pathParts[pathParts.length - 1];
if (!lastPart.includes('.')) { if (!lastPart.includes('.') && !lastPart.includes('*')) {
return `${pattern}${path.sep}**`; return `${pattern}/**`;
} }
else { else {
return pattern; return pattern;
@@ -29086,10 +29132,6 @@ function getNodeRequestOptions(request) {
agent = agent(parsedURL); agent = agent(parsedURL);
} }
if (!headers.has('Connection') && !agent) {
headers.set('Connection', 'close');
}
// HTTP-network fetch step 4.2 // HTTP-network fetch step 4.2
// chunked encoding is handled by Node.js // chunked encoding is handled by Node.js

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -10,7 +10,7 @@
"build": "tsc", "build": "tsc",
"format": "prettier --write **/*.ts", "format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts", "format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts", "lint": "eslint **/*.ts --max-warnings 0",
"lint:fix": "eslint --fix src/**/*.ts", "lint:fix": "eslint --fix src/**/*.ts",
"package": "ncc build lib/main.js --source-map --license licenses.txt", "package": "ncc build lib/main.js --source-map --license licenses.txt",
"test": "jest --coverage", "test": "jest --coverage",
@@ -53,6 +53,7 @@
"eslint-plugin-github": "^4.8.0", "eslint-plugin-github": "^4.8.0",
"eslint-plugin-jest": "^27.2.2", "eslint-plugin-jest": "^27.2.2",
"eslint-plugin-prettier": "^5.0.0-alpha.2", "eslint-plugin-prettier": "^5.0.0-alpha.2",
"eslint-config-prettier": "^9.0.0",
"jest": "^29.5.0", "jest": "^29.5.0",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",

View File

@@ -74,6 +74,7 @@ describe('utils test', () => {
// Tests that the function returns the correct dirname when the relative path is a Windows drive root and excludeCurrentDir is true // Tests that the function returns the correct dirname when the relative path is a Windows drive root and excludeCurrentDir is true
it('test_windows_drive_root_and_exclude_current_dir_is_true', () => { it('test_windows_drive_root_and_exclude_current_dir_is_true', () => {
mockedPlatform('win32')
const result = getDirnameMaxDepth({ const result = getDirnameMaxDepth({
relativePath: 'C:\\', relativePath: 'C:\\',
dirNamesMaxDepth: 1, dirNamesMaxDepth: 1,
@@ -107,6 +108,7 @@ describe('utils test', () => {
// Tests that getDirnameMaxDepth returns the correct output for a Windows UNC root path // Tests that getDirnameMaxDepth returns the correct output for a Windows UNC root path
it('test_windows_unc_root', () => { it('test_windows_unc_root', () => {
mockedPlatform('win32')
const input = { const input = {
relativePath: '\\hello', relativePath: '\\hello',
dirNamesMaxDepth: 2, dirNamesMaxDepth: 2,
@@ -118,6 +120,7 @@ describe('utils test', () => {
// Tests that getDirnameMaxDepth returns an empty string when given a Windows UNC root and excludeCurrentDir is true // Tests that getDirnameMaxDepth returns an empty string when given a Windows UNC root and excludeCurrentDir is true
it('test_windows_unc_root_exclude_current_dir', () => { it('test_windows_unc_root_exclude_current_dir', () => {
mockedPlatform('win32')
const relativePath = '\\hello' const relativePath = '\\hello'
const result = getDirnameMaxDepth({ const result = getDirnameMaxDepth({
relativePath, relativePath,
@@ -152,6 +155,7 @@ describe('utils test', () => {
// Tests that the function returns the correct dirname for a valid Windows UNC root path // Tests that the function returns the correct dirname for a valid Windows UNC root path
it('test windows unc root path', () => { it('test windows unc root path', () => {
mockedPlatform('win32')
expect(getDirname('\\helloworld')).toEqual('.') expect(getDirname('\\helloworld')).toEqual('.')
}) })
@@ -162,6 +166,7 @@ describe('utils test', () => {
// Tests that the function returns the correct dirname for a Windows UNC root path with a trailing slash // Tests that the function returns the correct dirname for a Windows UNC root path with a trailing slash
it('test windows unc root path with trailing slash', () => { it('test windows unc root path with trailing slash', () => {
mockedPlatform('win32')
expect(getDirname('\\hello\\world\\')).toEqual('.') expect(getDirname('\\hello\\world\\')).toEqual('.')
}) })
@@ -172,6 +177,7 @@ describe('utils test', () => {
// Tests that the function returns the correct dirname for a Windows UNC root path with multiple slashes // Tests that the function returns the correct dirname for a Windows UNC root path with multiple slashes
it('test windows unc root path with multiple slashes', () => { it('test windows unc root path with multiple slashes', () => {
mockedPlatform('win32')
expect(getDirname('\\hello\\world')).toEqual('.') expect(getDirname('\\hello\\world')).toEqual('.')
}) })
}) })
@@ -194,6 +200,15 @@ describe('utils test', () => {
expect(actualOutput).toEqual(expectedOutput) expect(actualOutput).toEqual(expectedOutput)
}) })
// Tests that forward slashes are normalized on Windows
it('test mixed slashes windows', () => {
mockedPlatform('win32')
const input = 'path/to/file'
const expectedOutput = 'path\\to\\file'
const actualOutput = normalizeSeparators(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that mixed slashes are normalized on Windows // Tests that mixed slashes are normalized on Windows
it('test mixed slashes windows', () => { it('test mixed slashes windows', () => {
mockedPlatform('win32') mockedPlatform('win32')
@@ -221,6 +236,7 @@ describe('utils test', () => {
// Tests that UNC format is preserved on Windows // Tests that UNC format is preserved on Windows
it('test unc format windows', () => { it('test unc format windows', () => {
mockedPlatform('win32')
const input = '\\\\hello\\world' const input = '\\\\hello\\world'
const expectedOutput = '\\\\hello\\world' const expectedOutput = '\\\\hello\\world'
const actualOutput = normalizeSeparators(input) const actualOutput = normalizeSeparators(input)
@@ -229,6 +245,7 @@ describe('utils test', () => {
// Tests that a drive root is preserved on Windows // Tests that a drive root is preserved on Windows
it('test drive root windows', () => { it('test drive root windows', () => {
mockedPlatform('win32')
const input = 'C:\\' const input = 'C:\\'
const expectedOutput = 'C:\\' const expectedOutput = 'C:\\'
const actualOutput = normalizeSeparators(input) const actualOutput = normalizeSeparators(input)
@@ -236,8 +253,6 @@ describe('utils test', () => {
}) })
}) })
// Generated by CodiumAI
describe('getFilteredChangedFiles', () => { describe('getFilteredChangedFiles', () => {
// Tests that the function returns an empty object when allDiffFiles and filePatterns are empty // Tests that the function returns an empty object when allDiffFiles and filePatterns are empty
it('should return an empty object when allDiffFiles and filePatterns are empty', async () => { it('should return an empty object when allDiffFiles and filePatterns are empty', async () => {
@@ -312,7 +327,7 @@ describe('utils test', () => {
}) })
}) })
// Tests that the function returns only the files that match the file patterns // Tests that the function returns only the files that match the file patterns on non windows platforms
it('should return only the files that match the file patterns', async () => { it('should return only the files that match the file patterns', async () => {
const allDiffFiles = { const allDiffFiles = {
[ChangeTypeEnum.Added]: [ [ChangeTypeEnum.Added]: [
@@ -320,7 +335,7 @@ describe('utils test', () => {
'file2.md', 'file2.md',
'file3.txt', 'file3.txt',
'test/dir/file4.txt', 'test/dir/file4.txt',
'/test/dir/file5.txt', 'test/dir/file5.txt',
'dir/file6.md' 'dir/file6.md'
], ],
[ChangeTypeEnum.Copied]: [], [ChangeTypeEnum.Copied]: [],
@@ -347,7 +362,44 @@ describe('utils test', () => {
}) })
}) })
// Tests that the function returns only the files that match the file patterns with globstar // Tests that the function returns only the files that match the file patterns on windows
it('should return only the files that match the file patterns on windows', async () => {
mockedPlatform('win32')
const allDiffFiles = {
[ChangeTypeEnum.Added]: [
'file1.txt',
'file2.md',
'file3.txt',
'test\\dir\\file4.txt',
'test\\dir\\file5.txt',
'dir\\file6.md'
],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const result = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: ['*.txt']
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: ['file1.txt', 'file3.txt'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that the function returns only the files that match the file patterns with globstar on non windows platforms
it('should return only the files that match the file patterns with globstar', async () => { it('should return only the files that match the file patterns with globstar', async () => {
const allDiffFiles = { const allDiffFiles = {
[ChangeTypeEnum.Added]: [ [ChangeTypeEnum.Added]: [
@@ -355,7 +407,7 @@ describe('utils test', () => {
'file2.md', 'file2.md',
'file3.txt', 'file3.txt',
'test/dir/file4.txt', 'test/dir/file4.txt',
'/test/dir/file5.txt', 'test/dir/file5.txt',
'dir/file6.md' 'dir/file6.md'
], ],
[ChangeTypeEnum.Copied]: [], [ChangeTypeEnum.Copied]: [],
@@ -375,7 +427,7 @@ describe('utils test', () => {
'file1.txt', 'file1.txt',
'file3.txt', 'file3.txt',
'test/dir/file4.txt', 'test/dir/file4.txt',
'/test/dir/file5.txt' 'test/dir/file5.txt'
], ],
[ChangeTypeEnum.Copied]: [], [ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [], [ChangeTypeEnum.Deleted]: [],
@@ -387,6 +439,35 @@ describe('utils test', () => {
}) })
}) })
// Tests that the function returns only the files that match the file patterns with globstar on windows
it('should return only the files that match the file patterns with globstar on windows', async () => {
mockedPlatform('win32')
const allDiffFiles = {
[ChangeTypeEnum.Added]: ['test\\test rename-1.txt'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const result = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: ['test/**']
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: ['test\\test rename-1.txt'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that the function returns an empty object when there are no files that match the file patterns // Tests that the function returns an empty object when there are no files that match the file patterns
it('should return an empty object when there are no files that match the file patterns', async () => { it('should return an empty object when there are no files that match the file patterns', async () => {
const allDiffFiles = { const allDiffFiles = {

View File

@@ -2,15 +2,19 @@ import * as core from '@actions/core'
import * as github from '@actions/github' import * as github from '@actions/github'
import type {RestEndpointMethodTypes} from '@octokit/rest' import type {RestEndpointMethodTypes} from '@octokit/rest'
import flatten from 'lodash/flatten' import flatten from 'lodash/flatten'
import mm from 'micromatch'
import * as path from 'path' import * as path from 'path'
import {DiffResult} from './commitSha' import {DiffResult} from './commitSha'
import {Inputs} from './inputs' import {Inputs} from './inputs'
import { import {
canDiffCommits,
getAllChangedFiles, getAllChangedFiles,
getDirnameMaxDepth, getDirnameMaxDepth,
getDirNamesIncludeFilesPattern,
gitRenamedFiles, gitRenamedFiles,
gitSubmoduleDiffSHA, gitSubmoduleDiffSHA,
isWindows,
jsonOutput jsonOutput
} from './utils' } from './utils'
@@ -51,11 +55,24 @@ export const getRenamedFiles = async ({
) )
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) { if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
let diff = '...'
if (
!(await canDiffCommits({
cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha,
diff
}))
) {
diff = '..'
}
const submoduleRenamedFiles = await gitRenamedFiles({ const submoduleRenamedFiles = await gitRenamedFiles({
cwd: submoduleWorkingDirectory, cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha, sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha, sha2: submoduleShaResult.currentSha,
diff: diffResult.diff, diff,
oldNewSeparator: inputs.oldNewSeparator, oldNewSeparator: inputs.oldNewSeparator,
isSubmodule: true, isSubmodule: true,
parentDir: submodulePath parentDir: submodulePath
@@ -130,11 +147,24 @@ export const getAllDiffFiles = async ({
) )
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) { if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
let diff = '...'
if (
!(await canDiffCommits({
cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha,
diff
}))
) {
diff = '..'
}
const submoduleFiles = await getAllChangedFiles({ const submoduleFiles = await getAllChangedFiles({
cwd: submoduleWorkingDirectory, cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha, sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha, sha2: submoduleShaResult.currentSha,
diff: diffResult.diff, diff,
isSubmodule: true, isSubmodule: true,
parentDir: submodulePath, parentDir: submodulePath,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded
@@ -155,6 +185,35 @@ export const getAllDiffFiles = async ({
return files return files
} }
function* getFilePaths({
inputs,
filePaths,
dirNamesIncludeFilePatterns
}: {
inputs: Inputs
filePaths: string[]
dirNamesIncludeFilePatterns: string[]
}): Generator<string> {
for (const filePath of filePaths) {
if (inputs.dirNames) {
if (dirNamesIncludeFilePatterns.length > 0) {
const isWin = isWindows()
const matchOptions = {dot: true, windows: isWin, noext: true}
if (mm.isMatch(filePath, dirNamesIncludeFilePatterns, matchOptions)) {
yield filePath
}
}
yield getDirnameMaxDepth({
relativePath: filePath,
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
})
} else {
yield filePath
}
}
}
function* getChangeTypeFilesGenerator({ function* getChangeTypeFilesGenerator({
inputs, inputs,
changedFiles, changedFiles,
@@ -164,18 +223,21 @@ function* getChangeTypeFilesGenerator({
changedFiles: ChangedFiles changedFiles: ChangedFiles
changeTypes: ChangeTypeEnum[] changeTypes: ChangeTypeEnum[]
}): Generator<string> { }): Generator<string> {
const dirNamesIncludeFilePatterns = getDirNamesIncludeFilesPattern({inputs})
core.debug(
`Dir names include file patterns: ${JSON.stringify(
dirNamesIncludeFilePatterns
)}`
)
for (const changeType of changeTypes) { for (const changeType of changeTypes) {
const files = changedFiles[changeType] || [] const filePaths = changedFiles[changeType] || []
for (const filePath of files) { for (const filePath of getFilePaths({
if (inputs.dirNames) { inputs,
yield getDirnameMaxDepth({ filePaths,
relativePath: filePath, dirNamesIncludeFilePatterns
dirNamesMaxDepth: inputs.dirNamesMaxDepth, })) {
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir yield filePath
})
} else {
yield filePath
}
} }
} }
} }
@@ -213,16 +275,21 @@ function* getAllChangeTypeFilesGenerator({
inputs: Inputs inputs: Inputs
changedFiles: ChangedFiles changedFiles: ChangedFiles
}): Generator<string> { }): Generator<string> {
for (const filePath of flatten(Object.values(changedFiles))) { const dirNamesIncludeFilePatterns = getDirNamesIncludeFilesPattern({inputs})
if (inputs.dirNames) { core.debug(
yield getDirnameMaxDepth({ `Dir names include file patterns: ${JSON.stringify(
relativePath: filePath, dirNamesIncludeFilePatterns
dirNamesMaxDepth: inputs.dirNamesMaxDepth, )}`
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir )
})
} else { const filePaths = flatten(Object.values(changedFiles))
yield filePath
} for (const filePath of getFilePaths({
inputs,
filePaths,
dirNamesIncludeFilePatterns
})) {
yield filePath
} }
} }
@@ -278,9 +345,10 @@ export const getChangedFilesFromGithubAPI = async ({
per_page: 100 per_page: 100
}) })
const paginatedResponse = await octokit.paginate< const paginatedResponse =
RestEndpointMethodTypes['pulls']['listFiles']['response']['data'][0] await octokit.paginate<
>(options) RestEndpointMethodTypes['pulls']['listFiles']['response']['data'][0]
>(options)
core.info(`Found ${paginatedResponse.length} changed files from GitHub API`) core.info(`Found ${paginatedResponse.length} changed files from GitHub API`)
const statusMap: Record<string, ChangeTypeEnum> = { const statusMap: Record<string, ChangeTypeEnum> = {

View File

@@ -29,6 +29,8 @@ export type Inputs = {
dirNames: boolean dirNames: boolean
dirNamesMaxDepth?: number dirNamesMaxDepth?: number
dirNamesExcludeCurrentDir: boolean dirNamesExcludeCurrentDir: boolean
dirNamesIncludeFiles: string
dirNamesIncludeFilesSeparator: string
json: boolean json: boolean
escapeJson: boolean escapeJson: boolean
fetchDepth?: number fetchDepth?: number
@@ -135,6 +137,16 @@ export const getInputs = (): Inputs => {
required: false required: false
} }
) )
const dirNamesIncludeFiles = core.getInput('dir_names_include_files', {
required: false
})
const dirNamesIncludeFilesSeparator = core.getInput(
'dir_names_include_files_separator',
{
required: false,
trimWhitespace: false
}
)
const json = core.getBooleanInput('json', {required: false}) const json = core.getBooleanInput('json', {required: false})
const escapeJson = core.getBooleanInput('escape_json', {required: false}) const escapeJson = core.getBooleanInput('escape_json', {required: false})
const fetchDepth = core.getInput('fetch_depth', {required: false}) const fetchDepth = core.getInput('fetch_depth', {required: false})
@@ -212,17 +224,19 @@ export const getInputs = (): Inputs => {
includeAllOldNewRenamedFiles, includeAllOldNewRenamedFiles,
oldNewSeparator, oldNewSeparator,
oldNewFilesSeparator, oldNewFilesSeparator,
skipInitialFetch,
// End Not Supported via REST API // End Not Supported via REST API
dirNames, dirNames,
dirNamesExcludeCurrentDir, dirNamesExcludeCurrentDir,
dirNamesIncludeFiles,
dirNamesIncludeFilesSeparator,
json, json,
escapeJson, escapeJson,
writeOutputFiles, writeOutputFiles,
outputDir, outputDir,
outputRenamedFilesAsDeletedAndAdded, outputRenamedFilesAsDeletedAndAdded,
token, token,
apiUrl, apiUrl
skipInitialFetch
} }
if (fetchDepth) { if (fetchDepth) {

View File

@@ -11,8 +11,8 @@ import {
import {setChangedFilesOutput} from './changedFilesOutput' import {setChangedFilesOutput} from './changedFilesOutput'
import { import {
DiffResult, DiffResult,
getSHAForPullRequestEvent, getSHAForNonPullRequestEvent,
getSHAForNonPullRequestEvent getSHAForPullRequestEvent
} from './commitSha' } from './commitSha'
import {Env, getEnv} from './env' import {Env, getEnv} from './env'
import {getInputs, Inputs} from './inputs' import {getInputs, Inputs} from './inputs'
@@ -314,7 +314,10 @@ export async function run(): Promise<void> {
'sinceLastRemoteCommit', 'sinceLastRemoteCommit',
'recoverDeletedFiles', 'recoverDeletedFiles',
'recoverDeletedFilesToDestination', 'recoverDeletedFilesToDestination',
'includeAllOldNewRenamedFiles' 'recoverFiles',
'recoverFilesIgnore',
'includeAllOldNewRenamedFiles',
'skipInitialFetch'
] ]
for (const input of unsupportedInputs) { for (const input of unsupportedInputs) {

View File

@@ -38,15 +38,6 @@ export const normalizeSeparators = (p: string): string => {
return p.replace(/\/\/+/g, '/') return p.replace(/\/\/+/g, '/')
} }
/**
* Normalize file path separators to '/' on all platforms
* @param p - file path
* @returns file path with normalized separators
*/
const normalizePath = (p: string): string => {
return p.replace(/\\/g, '/')
}
/** /**
* Trims unnecessary trailing slash from file path * Trims unnecessary trailing slash from file path
* @param p - file path * @param p - file path
@@ -365,7 +356,7 @@ export const getSubmodulePath = async ({
return stdout return stdout
.trim() .trim()
.split('\n') .split('\n')
.map((line: string) => normalizePath(line.trim().split(' ')[1])) .map((line: string) => normalizeSeparators(line.trim().split(' ')[1]))
} }
/** /**
@@ -478,13 +469,15 @@ export const gitRenamedFiles = async ({
core.debug(`Renamed file: ${line}`) core.debug(`Renamed file: ${line}`)
const [, oldPath, newPath] = line.split('\t') const [, oldPath, newPath] = line.split('\t')
if (isSubmodule) { if (isSubmodule) {
return `${normalizePath( return `${normalizeSeparators(
path.join(parentDir, oldPath) path.join(parentDir, oldPath)
)}${oldNewSeparator}${normalizePath(path.join(parentDir, newPath))}` )}${oldNewSeparator}${normalizeSeparators(
path.join(parentDir, newPath)
)}`
} }
return `${normalizePath(oldPath)}${oldNewSeparator}${normalizePath( return `${normalizeSeparators(
newPath oldPath
)}` )}${oldNewSeparator}${normalizeSeparators(newPath)}`
}) })
} }
@@ -564,11 +557,11 @@ export const getAllChangedFiles = async ({
for (const line of lines) { for (const line of lines) {
const [changeType, filePath, newPath = ''] = line.split('\t') const [changeType, filePath, newPath = ''] = line.split('\t')
const normalizedFilePath = isSubmodule const normalizedFilePath = isSubmodule
? normalizePath(path.join(parentDir, filePath)) ? normalizeSeparators(path.join(parentDir, filePath))
: normalizePath(filePath) : normalizeSeparators(filePath)
const normalizedNewPath = isSubmodule const normalizedNewPath = isSubmodule
? normalizePath(path.join(parentDir, newPath)) ? normalizeSeparators(path.join(parentDir, newPath))
: normalizePath(newPath) : normalizeSeparators(newPath)
if (changeType.startsWith('R')) { if (changeType.startsWith('R')) {
if (outputRenamedFilesAsDeletedAndAdded) { if (outputRenamedFilesAsDeletedAndAdded) {
@@ -607,15 +600,16 @@ export const getFilteredChangedFiles = async ({
[ChangeTypeEnum.Unknown]: [] [ChangeTypeEnum.Unknown]: []
} }
const hasFilePatterns = filePatterns.length > 0 const hasFilePatterns = filePatterns.length > 0
const isWin = isWindows()
for (const changeType of Object.keys(allDiffFiles)) { for (const changeType of Object.keys(allDiffFiles)) {
const files = allDiffFiles[changeType as ChangeTypeEnum] const files = allDiffFiles[changeType as ChangeTypeEnum]
if (hasFilePatterns) { if (hasFilePatterns) {
changedFiles[changeType as ChangeTypeEnum] = mm(files, filePatterns, { changedFiles[changeType as ChangeTypeEnum] = mm(files, filePatterns, {
dot: true, dot: true,
windows: isWindows(), windows: isWin,
noext: true noext: true
}) }).map(normalizeSeparators)
} else { } else {
changedFiles[changeType as ChangeTypeEnum] = files changedFiles[changeType as ChangeTypeEnum] = files
} }
@@ -745,7 +739,7 @@ export const getPreviousGitTag = async ({
}): Promise<{tag: string; sha: string}> => { }): Promise<{tag: string; sha: string}> => {
const {stdout} = await exec.getExecOutput( const {stdout} = await exec.getExecOutput(
'git', 'git',
['tag', '--sort=-version:refname'], ['tag', '--sort=-creatordate'],
{ {
cwd, cwd,
silent: !core.isDebug() silent: !core.isDebug()
@@ -873,7 +867,7 @@ export const getDirnameMaxDepth = ({
return '' return ''
} }
return normalizePath(output) return normalizeSeparators(output)
} }
export const jsonOutput = ({ export const jsonOutput = ({
@@ -888,6 +882,16 @@ export const jsonOutput = ({
return shouldEscape ? result.replace(/"/g, '\\"') : result return shouldEscape ? result.replace(/"/g, '\\"') : result
} }
export const getDirNamesIncludeFilesPattern = ({
inputs
}: {
inputs: Inputs
}): string[] => {
return inputs.dirNamesIncludeFiles
.split(inputs.dirNamesIncludeFilesSeparator)
.filter(Boolean)
}
export const getFilePatterns = async ({ export const getFilePatterns = async ({
inputs, inputs,
workingDirectory workingDirectory
@@ -897,7 +901,7 @@ export const getFilePatterns = async ({
}): Promise<string[]> => { }): Promise<string[]> => {
let filePatterns = inputs.files let filePatterns = inputs.files
.split(inputs.filesSeparator) .split(inputs.filesSeparator)
.filter(p => p !== '') .filter(Boolean)
.join('\n') .join('\n')
if (inputs.filesFromSourceFile !== '') { if (inputs.filesFromSourceFile !== '') {
@@ -963,7 +967,7 @@ export const getFilePatterns = async ({
filePatterns = filePatterns.replace(/\r/g, '\n') filePatterns = filePatterns.replace(/\r/g, '\n')
} }
core.debug(`file patterns: ${filePatterns}`) core.debug(`Input file patterns: ${filePatterns}`)
return filePatterns return filePatterns
.trim() .trim()
@@ -973,10 +977,10 @@ export const getFilePatterns = async ({
if (pattern.endsWith('/')) { if (pattern.endsWith('/')) {
return `${pattern}**` return `${pattern}**`
} else { } else {
const pathParts = pattern.split(path.sep) const pathParts = pattern.split('/')
const lastPart = pathParts[pathParts.length - 1] const lastPart = pathParts[pathParts.length - 1]
if (!lastPart.includes('.')) { if (!lastPart.includes('.') && !lastPart.includes('*')) {
return `${pattern}${path.sep}**` return `${pattern}/**`
} else { } else {
return pattern return pattern
} }

1084
yarn.lock

File diff suppressed because it is too large Load Diff