Compare commits

...

30 Commits

Author SHA1 Message Date
Tonye Jack
54479c37f5 fix: bug with returning old filename in renamed files output (#1281)
Co-authored-by: GitHub Action <action@github.com>
2023-06-19 21:34:12 +00:00
renovate[bot]
6d89069134 chore(deps): update typescript-eslint monorepo to v5.60.0 (#1282)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-19 12:49:56 -06:00
renovate[bot]
3bbaba4ae7 chore(deps): update reviewdog/action-shellcheck action to v1.18 (#1279)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-19 16:47:52 +00:00
Tonye Jack
18c62c592a Update action.yml 2023-06-19 09:48:20 -06:00
renovate[bot]
c39b06f825 chore(deps): update dependency eslint-plugin-jest to v27.2.2 (#1278)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-19 10:16:23 +00:00
renovate[bot]
4c2f8eda37 chore(deps): lock file maintenance (#1277)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-18 22:15:24 +00:00
tj-actions[bot]
2c8123e91e Upgraded to v36.4.0 (#1275)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-06-17 03:56:37 +00:00
tj-actions[bot]
e1754a427f Updated README.md (#1274)
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
2023-06-17 03:30:45 +00:00
Tonye Jack
f573054697 feat: add support for returning changed file counts (#1273)
Co-authored-by: GitHub Action <action@github.com>
2023-06-17 03:13:40 +00:00
Tonye Jack
c3c3db7fee feat: move deleted file recovery to leverage filter (#1272) 2023-06-16 20:33:42 -06:00
renovate[bot]
480e87dd66 chore(deps): lock file maintenance (#1271)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-16 20:33:22 -06:00
tj-actions[bot]
7fcd53ac00 Updated README.md (#1270)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-06-16 19:40:34 -06:00
Tonye Jack
749fe3bb28 Merge branch 'feat/add-support-for-recovering-deleted-files' 2023-06-16 19:01:25 -06:00
Tonye Jack
d7af20bab3 Update README.md 2023-06-16 18:59:17 -06:00
Tonye Jack
690b721958 Update README.md 2023-06-16 18:57:56 -06:00
Tonye Jack
77f9e6c7c6 feat: add support for recovering deleted files (#1269)
Co-authored-by: GitHub Action <action@github.com>
2023-06-17 00:57:12 +00:00
Tonye Jack
c82a34e7e5 Updated the test 2023-06-16 18:44:56 -06:00
Tonye Jack
7a1c64e8b1 Updated the test 2023-06-16 18:30:35 -06:00
Tonye Jack
71290f02ff Updated dist assets 2023-06-16 18:25:34 -06:00
Tonye Jack
ecf455a884 Updated test 2023-06-16 18:25:09 -06:00
Tonye Jack
432e0c810c Removed test file 2023-06-16 18:25:09 -06:00
Tonye Jack
fcdeb5b3d7 Added deleted file 2023-06-16 18:25:09 -06:00
GitHub Action
01e83d6024 Added missing changes and modified dist assets. 2023-06-16 23:54:47 +00:00
Tonye Jack
c706c70eed Merge d4f86e9d16 into 0621d936c0 2023-06-16 17:53:39 -06:00
Tonye Jack
d4f86e9d16 Merge branch 'main' into feat/add-support-for-recovering-deleted-files 2023-06-16 17:53:37 -06:00
Tonye Jack
d9105a4631 feat: add support for recovering deleted files 2023-06-16 17:52:27 -06:00
renovate[bot]
0621d936c0 chore(deps): update dependency eslint to v8.43.0 (#1268)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-16 23:08:47 +00:00
Tonye Jack
024cd58ac6 Update README.md 2023-06-16 11:27:13 -06:00
Tonye Jack
c9a1c56f6d Update README.md 2023-06-16 01:37:49 -06:00
tj-actions[bot]
54a8c99a03 Upgraded to v36.3.0 (#1267)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-06-16 07:06:33 +00:00
13 changed files with 900 additions and 163 deletions

View File

@@ -39,7 +39,7 @@ jobs:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: shellcheck - name: shellcheck
uses: reviewdog/action-shellcheck@v1.17 uses: reviewdog/action-shellcheck@v1.18
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -601,6 +601,155 @@ jobs:
shell: shell:
bash bash
test_recover_deleted_file:
name: Test changed-files recover deleted file
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
max-parallel: 4
matrix:
fetch-depth: [0, 1, 2]
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive
fetch-depth: ${{ matrix.fetch-depth }}
- name: Download build assets
uses: actions/download-artifact@v3
with:
name: build-assets
- name: Run changed-files with recover_deleted_files
id: changed-files-recover-deleted-files
uses: ./
with:
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
recover_deleted_files: true
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files-recover-deleted-files.outputs) }}"
shell:
bash
- name: Verify deleted files
if: steps.changed-files-recover-deleted-files.outputs.deleted_files != 'test/test deleted.txt'
run: |
echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files.outputs.deleted_files }}"
exit 1
- name: Verify that test/test deleted.txt is restored
run: |
if [ ! -f "test/test deleted.txt" ]; then
echo "Expected: (test/test deleted.txt) to exist"
exit 1
else
cat "test/test deleted.txt"
rm "test/test deleted.txt"
fi
- name: Run changed-files with recover_deleted_files and files input
id: changed-files-recover-deleted-files-with-files
uses: ./
with:
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
files: |
test
recover_deleted_files: true
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files-recover-deleted-files-with-files.outputs) }}"
shell:
bash
- name: Verify deleted files
if: steps.changed-files-recover-deleted-files-with-files.outputs.deleted_files != 'test/test deleted.txt'
run: |
echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-with-files.outputs.deleted_files }}"
exit 1
- name: Verify that test/test deleted.txt is restored
run: |
if [ ! -f "test/test deleted.txt" ]; then
echo "Expected: (test/test deleted.txt) to exist"
exit 1
else
cat "test/test deleted.txt"
rm "test/test deleted.txt"
fi
- name: Run changed-files with recover_deleted_files and files_yaml input
id: changed-files-recover-deleted-files-with-files-yaml
uses: ./
with:
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
files_yaml: |
test:
- test/**.txt
- test/**.md
recover_deleted_files: true
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files-recover-deleted-files-with-files-yaml.outputs) }}"
shell:
bash
- name: Verify deleted files
if: steps.changed-files-recover-deleted-files-with-files-yaml.outputs.test_deleted_files != 'test/test deleted.txt'
run: |
echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-with-files-yaml.outputs.test_deleted_files }}"
exit 1
- name: Verify that test/test deleted.txt is restored
run: |
if [ ! -f "test/test deleted.txt" ]; then
echo "Expected: (test/test deleted.txt) to exist"
exit 1
else
cat "test/test deleted.txt"
rm "test/test deleted.txt"
fi
- name: Run changed-files with recover_deleted_files and recover_deleted_files_to_destination
id: changed-files-recover-deleted-files-to-destination
uses: ./
with:
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
recover_deleted_files: true
recover_deleted_files_to_destination: "deleted_files"
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files-recover-deleted-files-to-destination.outputs) }}"
shell:
bash
- name: Verify deleted files
if: steps.changed-files-recover-deleted-files-to-destination.outputs.deleted_files != 'test/test deleted.txt'
run: |
echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-to-destination.outputs.deleted_files }}"
exit 1
- name: Verify that test/test deleted.txt is restored
run: |
if [ ! -f "deleted_files/test/test deleted.txt" ]; then
echo "Expected: (deleted_files/test/test deleted.txt) to exist"
exit 1
else
cat "deleted_files/test/test deleted.txt"
fi
test: test:
name: Test changed-files name: Test changed-files
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
@@ -899,6 +1048,13 @@ jobs:
exit 1 exit 1
shell: shell:
bash bash
- name: Check the renamed_files output
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt')"
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 }})"
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: ./
@@ -919,6 +1075,13 @@ jobs:
exit 1 exit 1
shell: shell:
bash bash
- name: Check the renamed_files output
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt')"
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 }})"
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: ./

View File

@@ -1,5 +1,95 @@
# Changelog # Changelog
# [36.4.0](https://github.com/tj-actions/changed-files/compare/v36.3.0...v36.4.0) - (2023-06-17)
## <!-- 0 -->🚀 Features
- Add support for returning changed file counts ([#1273](https://github.com/tj-actions/changed-files/issues/1273)) ([f573054](https://github.com/tj-actions/changed-files/commit/f573054697fceee32a3bbc0ecf27286247aabb56)) - (Tonye Jack)
- Move deleted file recovery to leverage filter ([#1272](https://github.com/tj-actions/changed-files/issues/1272)) ([c3c3db7](https://github.com/tj-actions/changed-files/commit/c3c3db7feee6dc9447b2c03b41ae18e63e043fe2)) - (Tonye Jack)
- Add support for recovering deleted files ([#1269](https://github.com/tj-actions/changed-files/issues/1269)) ([77f9e6c](https://github.com/tj-actions/changed-files/commit/77f9e6c7c636ec1a11598091308b26a1c1ccf131)) - (Tonye Jack)
- Add support for recovering deleted files ([d9105a4](https://github.com/tj-actions/changed-files/commit/d9105a4631593f0dc11f3ae6bfbcb5ac43625523)) - (Tonye Jack)
## <!-- 16 --> Add
- Added deleted file
([fcdeb5b](https://github.com/tj-actions/changed-files/commit/fcdeb5b3d797752d95f6dbe98552a95c29dad338)) - (Tonye Jack)
- Added missing changes and modified dist assets.
([01e83d6](https://github.com/tj-actions/changed-files/commit/01e83d602481802f6822004896b864b1e5e56cfb)) - (GitHub Action)
## <!-- 17 --> Remove
- Removed test file
([432e0c8](https://github.com/tj-actions/changed-files/commit/432e0c810c60ef1332850a971c5ec39022034b4c)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1274](https://github.com/tj-actions/changed-files/issues/1274))
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([e1754a4](https://github.com/tj-actions/changed-files/commit/e1754a427f478b8778d349341b8f1d80f1f47f44)) - (tj-actions[bot])
- Updated README.md ([#1270](https://github.com/tj-actions/changed-files/issues/1270))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([7fcd53a](https://github.com/tj-actions/changed-files/commit/7fcd53ac001f9faf1b1f57a58e10cd958da114ed)) - (tj-actions[bot])
- Update README.md ([d7af20b](https://github.com/tj-actions/changed-files/commit/d7af20bab3d42577ec79dffc4e793c14d0df65b3)) - (Tonye Jack)
- Update README.md ([690b721](https://github.com/tj-actions/changed-files/commit/690b721958b0220fa3f827e13559c5023d277b61)) - (Tonye Jack)
- Updated the test
([c82a34e](https://github.com/tj-actions/changed-files/commit/c82a34e7e5e87a5c69ee4aff0facae82e5177e3b)) - (Tonye Jack)
- Updated the test
([7a1c64e](https://github.com/tj-actions/changed-files/commit/7a1c64e8b15493fe087b9289d565d0502f1a97ab)) - (Tonye Jack)
- Updated dist assets
([71290f0](https://github.com/tj-actions/changed-files/commit/71290f02ff8f886712b65679f29e64216aa3e131)) - (Tonye Jack)
- Updated test
([ecf455a](https://github.com/tj-actions/changed-files/commit/ecf455a884019154bc08fa00fa237fd5a07b2287)) - (Tonye Jack)
- Update README.md ([024cd58](https://github.com/tj-actions/changed-files/commit/024cd58ac6e73a0f9617287edc3954db32e85394)) - (Tonye Jack)
- Update README.md ([c9a1c56](https://github.com/tj-actions/changed-files/commit/c9a1c56f6da50ec6d7986486064919eaeea692cc)) - (Tonye Jack)
## <!-- 30 -->📝 Other
- Merge branch 'feat/add-support-for-recovering-deleted-files'
([749fe3b](https://github.com/tj-actions/changed-files/commit/749fe3bb283cc8d46fc71f976e78eb6e1669f37d)) - (Tonye Jack)
- Merge d4f86e9d1689a5d2ddb94e173669f31cc3497351 into 0621d936c0d15c7a5a116268ea1f7c362b76c50b
([c706c70](https://github.com/tj-actions/changed-files/commit/c706c70eed92c7d5843cd3921da0a078663423e8)) - (Tonye Jack)
- Merge branch 'main' into feat/add-support-for-recovering-deleted-files ([d4f86e9](https://github.com/tj-actions/changed-files/commit/d4f86e9d1689a5d2ddb94e173669f31cc3497351)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Lock file maintenance ([#1271](https://github.com/tj-actions/changed-files/issues/1271)) ([480e87d](https://github.com/tj-actions/changed-files/commit/480e87dd66bdf2a6036db2fd2ea72906a92cfde2)) - (renovate[bot])
- **deps:** Update dependency eslint to v8.43.0 ([#1268](https://github.com/tj-actions/changed-files/issues/1268)) ([0621d93](https://github.com/tj-actions/changed-files/commit/0621d936c0d15c7a5a116268ea1f7c362b76c50b)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v36.3.0 ([#1267](https://github.com/tj-actions/changed-files/issues/1267))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([54a8c99](https://github.com/tj-actions/changed-files/commit/54a8c99a03eb57f7f561696dd7879bea7587e469)) - (tj-actions[bot])
# [36.3.0](https://github.com/tj-actions/changed-files/compare/v36.2.1...v36.3.0) - (2023-06-16)
## <!-- 0 -->🚀 Features
- Add support for complex filters ([#1265](https://github.com/tj-actions/changed-files/issues/1265)) ([c25c77a](https://github.com/tj-actions/changed-files/commit/c25c77a67a4da177bd7550612cacb74714d054f6)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1266](https://github.com/tj-actions/changed-files/issues/1266))
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([9bf0914](https://github.com/tj-actions/changed-files/commit/9bf09145c3560e451e8d8e87b42ccb3fef5b692d)) - (tj-actions[bot])
- Updated README.md ([#1264](https://github.com/tj-actions/changed-files/issues/1264))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com> ([d144c0c](https://github.com/tj-actions/changed-files/commit/d144c0c92d678494b332227c803cea83b4f7bdee)) - (tj-actions[bot])
- Update README.md ([341b80d](https://github.com/tj-actions/changed-files/commit/341b80da8b4d69e7a389dc6f2df8c8ee41ea5736)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Update test.yml ([ea90b5c](https://github.com/tj-actions/changed-files/commit/ea90b5ced9a0c8d0d18077656d2ecada2bb67ff3)) - (Tonye Jack)
- Move check out of loop ([6cf9c82](https://github.com/tj-actions/changed-files/commit/6cf9c8246e3225cbcdc00d6c86ba6d6a05b2e231)) - (Tonye Jack)
- **deps:** Lock file maintenance ([#1263](https://github.com/tj-actions/changed-files/issues/1263)) ([9559461](https://github.com/tj-actions/changed-files/commit/955946132d0133d584404b86a03462e591ff30b3)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v36.2.1 ([#1262](https://github.com/tj-actions/changed-files/issues/1262))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([1f2cb3b](https://github.com/tj-actions/changed-files/commit/1f2cb3b00f32f8700ede1b03398337e39a64d448)) - (tj-actions[bot])
# [36.2.1](https://github.com/tj-actions/changed-files/compare/v36.2.0...v36.2.1) - (2023-06-14) # [36.2.1](https://github.com/tj-actions/changed-files/compare/v36.2.0...v36.2.1) - (2023-06-14)
## <!-- 0 -->🚀 Features ## <!-- 0 -->🚀 Features

112
README.md
View File

@@ -19,7 +19,7 @@
## changed-files ## changed-files
Retrieve all changed files and directories relative to a target branch, preceding commit or the last remote commit returning **relative paths** from the project root. Effortlessly track all changed files and directories relative to a target branch, preceding commit or the last remote commit returning **relative paths** from the project root.
## Table of contents ## Table of contents
@@ -39,34 +39,37 @@ Retrieve all changed files and directories relative to a target branch, precedin
## Features ## Features
* Fast execution (0-10 seconds on average). * Provides fast execution, averaging 0-10 seconds.
* Easy to debug. * Facilitates easy debugging.
* Scales to large repositories. * Scales to handle large repositories.
* Supports Git submodules. * Supports Git submodules.
* Escaped JSON output which can be used to run matrix jobs based on changed files. * Generates escaped JSON output for running matrix jobs based on changed files.
* List changed directories. * Lists changed directories.
* Limit the matching changed directories to a maximum depth. * Allows limiting the matching changed directories to a specified maximum depth.
* Optionally exclude the current directory * Optionally excludes the current directory.
* Write outputs to a `.txt` or `.json` file at a specified location for further processing. * Writes outputs to a designated `.txt` or `.json` file for further processing.
* Monorepos (Fetches a fixed number of commits). * Restores deleted files to their previous location or a newly specified location.
* Supports all platforms (Linux, MacOS, Windows). * Supports Monorepos by fetching a fixed number of commits.
* [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners) support * Compatible with all platforms (Linux, MacOS, Windows).
* [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.3/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server) support. * Supports [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners).
* [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) support. * Supports [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.3/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server).
* List all files and directories that have changed: * Supports [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners).
* Lists all files and directories that have changed:
* Between the current pull request branch and the last commit on the target branch. * Between the current pull request branch and the last commit on the target branch.
* Between the last commit and the current pushed change. * Between the last commit and the current pushed change.
* Between the last remote branch commit and the current HEAD. * Between the last remote branch commit and the current HEAD.
* Restrict change detection to a subset of files and directories: * Restricts change detection to a subset of files and directories:
* Boolean output indicating that certain files have been changed. * Provides boolean output indicating changes in specific files.
* Using [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching. * Uses [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching.
* Globstar. * Supports Globstar.
* Brace expansion. * Supports brace expansion.
* Negation. * Supports negation.
* Using [YAML](https://yaml.org/) syntax for specifying the patterns for files and directories. * Uses [YAML](https://yaml.org/) syntax for specifying patterns.
* Supports [YAML anchors & aliases](https://www.educative.io/blog/advanced-yaml-syntax-cheatsheet#anchors). * Supports [YAML anchors & aliases](https://www.educative.io/blog/advanced-yaml-syntax-cheatsheet#anchors).
* Supports [YAML multi-line strings](https://learnxinyminutes.com/docs/yaml/). * Supports [YAML multi-line strings](https://learnxinyminutes.com/docs/yaml/).
And many more.
## Usage ## Usage
> **Warning**: > **Warning**:
@@ -147,7 +150,7 @@ jobs:
echo "List all the files that have changed: ${{ steps.changed-files-excluded.outputs.all_changed_files }}" echo "List all the files that have changed: ${{ steps.changed-files-excluded.outputs.all_changed_files }}"
# Example 4 # Example 4
- name: Get all test files, doc and src files that have changed - name: Get all test, doc and src files that have changed
id: changed-files-yml id: changed-files-yml
uses: tj-actions/changed-files@v36 uses: tj-actions/changed-files@v36
with: with:
@@ -205,29 +208,44 @@ Support this project with a :star:
<!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section --> <!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section -->
| OUTPUT | TYPE | DESCRIPTION | | OUTPUT | TYPE | DESCRIPTION |
|--------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| added\_files | string | Returns only files that are <br>Added (A). | | added\_files | string | Returns only files that are <br>Added (A). |
| all\_changed\_and\_modified\_files | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* | | added\_files\_count | string | Returns the number of `added_files` |
| all\_changed\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* | | all\_changed\_and\_modified\_files | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* |
| all\_modified\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. | | all\_changed\_and\_modified\_files\_count | string | Returns the number of `all_changed_and_modified_files` |
| all\_old\_new\_renamed\_files | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) | | all\_changed\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* |
| any\_changed | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has changed. i.e. <br>*using a combination of all added, copied, modified and renamed files (ACMR)*. | | all\_changed\_files\_count | string | Returns the number of `all_changed_files` |
| any\_deleted | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been deleted. <br>(D) | | all\_modified\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. |
| any\_modified | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been modified. <br>i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. | | all\_modified\_files\_count | string | Returns the number of `all_modified_files` |
| copied\_files | string | Returns only files that are <br>Copied (C). | | all\_old\_new\_renamed\_files | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) |
| deleted\_files | string | Returns only files that are <br>Deleted (D). | | all\_old\_new\_renamed\_files\_count | string | Returns the number of `all_old_new_renamed_files` |
| modified\_files | string | Returns only files that are <br>Modified (M). | | any\_changed | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has changed. i.e. <br>*using a combination of all added, copied, modified and renamed files (ACMR)*. |
| only\_changed | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. | | any\_deleted | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been deleted. <br>(D) |
| only\_deleted | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been deleted. (D) | | any\_modified | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been modified. <br>i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
| only\_modified | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been modified. (ACMRD). | | copied\_files | string | Returns only files that are <br>Copied (C). |
| other\_changed\_files | string | Returns all other changed files <br>not listed in the files <br>input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. | | copied\_files\_count | string | Returns the number of `copied_files` |
| other\_deleted\_files | string | Returns all other deleted files <br>not listed in the files <br>input i.e. *a combination of all deleted files (D)* | | deleted\_files | string | Returns only files that are <br>Deleted (D). |
| other\_modified\_files | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* | | deleted\_files\_count | string | Returns the number of `deleted_files` |
| renamed\_files | string | Returns only files that are <br>Renamed (R). | | modified\_files | string | Returns only files that are <br>Modified (M). |
| type\_changed\_files | string | Returns only files that have <br>their file type changed (T). | | modified\_files\_count | string | Returns the number of `modified_files` |
| unknown\_files | string | Returns only files that are <br>Unknown (X). | | only\_changed | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. |
| unmerged\_files | string | Returns only files that are <br>Unmerged (U). | | only\_deleted | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been deleted. (D) |
| only\_modified | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been modified. (ACMRD). |
| other\_changed\_files | string | Returns all other changed files <br>not listed in the files <br>input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. |
| other\_changed\_files\_count | string | Returns the number of `other_changed_files` |
| other\_deleted\_files | string | Returns all other deleted files <br>not listed in the files <br>input i.e. *a combination of all deleted files (D)* |
| other\_deleted\_files\_count | string | Returns the number of `other_deleted_files` |
| other\_modified\_files | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* |
| other\_modified\_files\_count | string | Returns the number of `other_modified_files` |
| renamed\_files | string | Returns only files that are <br>Renamed (R). |
| renamed\_files\_count | string | Returns the number of `renamed_files` |
| type\_changed\_files | string | Returns only files that have <br>their file type changed (T). |
| type\_changed\_files\_count | string | Returns the number of `type_changed_files` |
| unknown\_files | string | Returns only files that are <br>Unknown (X). |
| unknown\_files\_count | string | Returns the number of `unknown_files` |
| unmerged\_files | string | Returns only files that are <br>Unmerged (U). |
| unmerged\_files\_count | string | Returns the number of `unmerged_files` |
<!-- AUTO-DOC-OUTPUT:END --> <!-- AUTO-DOC-OUTPUT:END -->
@@ -267,6 +285,8 @@ Support this project with a :star:
| output\_renamed\_files\_as\_deleted\_and\_added | string | false | `"false"` | Output renamed files as deleted <br>and added files. | | output\_renamed\_files\_as\_deleted\_and\_added | string | false | `"false"` | Output renamed files as deleted <br>and added files. |
| path | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. | | path | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. |
| quotepath | string | false | `"true"` | Use non-ascii characters to match <br>files and output the filenames <br>completely verbatim by setting this <br>to `false` | | quotepath | string | false | `"true"` | Use non-ascii characters to match <br>files and output the filenames <br>completely verbatim by setting this <br>to `false` |
| recover\_deleted\_files | string | false | `"false"` | Recover deleted files. |
| recover\_deleted\_files\_to\_destination | string | false | | Recover deleted files to a <br>new destination directory, defaults to <br>the original location. |
| separator | string | false | `" "` | Split character for output strings | | separator | string | false | `" "` | Split character for output strings |
| sha | string | false | | Specify a different commit SHA <br>used for comparing changes | | sha | string | false | | Specify a different commit SHA <br>used for comparing changes |
| since | string | false | | Get changed files for commits <br>whose timestamp is older than <br>the given time. | | since | string | false | | Get changed files for commits <br>whose timestamp is older than <br>the given time. |

View File

@@ -1,5 +1,5 @@
name: Changed Files name: Changed Files
description: Get all Added, Copied, Modified, Deleted, Renamed, Type changed, Unmerged, Unknown files. description: Get all Added, Copied, Modified, Deleted, Renamed, Type changed, Unmerged, and Unknown files.
author: tj-actions author: tj-actions
inputs: inputs:
@@ -145,50 +145,88 @@ inputs:
description: "Output renamed files as deleted and added files." description: "Output renamed files as deleted and added files."
required: false required: false
default: "false" default: "false"
recover_deleted_files:
description: "Recover deleted files."
required: false
default: "false"
recover_deleted_files_to_destination:
description: "Recover deleted files to a new destination directory, defaults to the original location."
required: false
default: ""
outputs: outputs:
added_files: added_files:
description: "Returns only files that are Added (A)." description: "Returns only files that are Added (A)."
added_files_count:
description: "Returns the number of `added_files`"
copied_files: copied_files:
description: "Returns only files that are Copied (C)." description: "Returns only files that are Copied (C)."
copied_files_count:
description: "Returns the number of `copied_files`"
deleted_files: deleted_files:
description: "Returns only files that are Deleted (D)." description: "Returns only files that are Deleted (D)."
deleted_files_count:
description: "Returns the number of `deleted_files`"
modified_files: modified_files:
description: "Returns only files that are Modified (M)." description: "Returns only files that are Modified (M)."
modified_files_count:
description: "Returns the number of `modified_files`"
renamed_files: renamed_files:
description: "Returns only files that are Renamed (R)." description: "Returns only files that are Renamed (R)."
renamed_files_count:
description: "Returns the number of `renamed_files`"
all_old_new_renamed_files: all_old_new_renamed_files:
description: "Returns only files that are Renamed and lists their old and new names. **NOTE:** This requires setting `include_all_old_new_renamed_files` to `true`. Also, keep in mind that this output is global and wouldn't be nested in outputs generated when the `*_yaml_*` input is used. (R)" description: "Returns only files that are Renamed and lists their old and new names. **NOTE:** This requires setting `include_all_old_new_renamed_files` to `true`. Also, keep in mind that this output is global and wouldn't be nested in outputs generated when the `*_yaml_*` input is used. (R)"
all_old_new_renamed_files_count:
description: "Returns the number of `all_old_new_renamed_files`"
type_changed_files: type_changed_files:
description: "Returns only files that have their file type changed (T)." description: "Returns only files that have their file type changed (T)."
type_changed_files_count:
description: "Returns the number of `type_changed_files`"
unmerged_files: unmerged_files:
description: "Returns only files that are Unmerged (U)." description: "Returns only files that are Unmerged (U)."
unmerged_files_count:
description: "Returns the number of `unmerged_files`"
unknown_files: unknown_files:
description: "Returns only files that are Unknown (X)." description: "Returns only files that are Unknown (X)."
unknown_files_count:
description: "Returns the number of `unknown_files`"
all_changed_and_modified_files: all_changed_and_modified_files:
description: "Returns all changed and modified files i.e. *a combination of (ACMRDTUX)*" description: "Returns all changed and modified files i.e. *a combination of (ACMRDTUX)*"
all_changed_and_modified_files_count:
description: "Returns the number of `all_changed_and_modified_files`"
all_changed_files: all_changed_files:
description: "Returns all changed files i.e. *a combination of all added, copied, modified and renamed files (ACMR)*" description: "Returns all changed files i.e. *a combination of all added, copied, modified and renamed files (ACMR)*"
all_changed_files_count:
description: "Returns the number of `all_changed_files`"
any_changed: any_changed:
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*." description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
only_changed: only_changed:
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*." description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
other_changed_files: other_changed_files:
description: "Returns all other changed files not listed in the files input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*." description: "Returns all other changed files not listed in the files input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
other_changed_files_count:
description: "Returns the number of `other_changed_files`"
all_modified_files: all_modified_files:
description: "Returns all changed files i.e. *a combination of all added, copied, modified, renamed and deleted files (ACMRD)*." description: "Returns all changed files i.e. *a combination of all added, copied, modified, renamed and deleted files (ACMRD)*."
all_modified_files_count:
description: "Returns the number of `all_modified_files`"
any_modified: any_modified:
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been modified. i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*." description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been modified. i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
only_modified: only_modified:
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been modified. (ACMRD)." description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been modified. (ACMRD)."
other_modified_files: other_modified_files:
description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*" description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*"
other_modified_files_count:
description: "Returns the number of `other_modified_files`"
any_deleted: any_deleted:
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been deleted. (D)" description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been deleted. (D)"
only_deleted: only_deleted:
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been deleted. (D)" description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been deleted. (D)"
other_deleted_files: other_deleted_files:
description: "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*" description: "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*"
other_deleted_files_count:
description: "Returns the number of `other_deleted_files`"
runs: runs:
using: 'node16' using: 'node16'

216
dist/index.js generated vendored
View File

@@ -79,9 +79,15 @@ const getRenamedFiles = ({ inputs, workingDirectory, hasSubmodule, diffResult, s
} }
} }
if (inputs.json) { if (inputs.json) {
return (0, utils_1.jsonOutput)({ value: renamedFiles, shouldEscape: inputs.escapeJson }); return {
paths: (0, utils_1.jsonOutput)({ value: renamedFiles, shouldEscape: inputs.escapeJson }),
count: renamedFiles.length.toString()
};
} }
return renamedFiles.join(inputs.oldNewFilesSeparator); return {
paths: renamedFiles.join(inputs.oldNewFilesSeparator),
count: renamedFiles.length.toString()
};
}); });
exports.getRenamedFiles = getRenamedFiles; exports.getRenamedFiles = getRenamedFiles;
var ChangeTypeEnum; var ChangeTypeEnum;
@@ -157,9 +163,15 @@ const getChangeTypeFiles = ({ inputs, changedFiles, changeTypes }) => __awaiter(
...new Set(getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes })) ...new Set(getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes }))
]; ];
if (inputs.json) { if (inputs.json) {
return (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }); return {
paths: (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }),
count: files.length.toString()
};
} }
return files.join(inputs.separator); return {
paths: files.join(inputs.separator),
count: files.length.toString()
};
}); });
exports.getChangeTypeFiles = getChangeTypeFiles; exports.getChangeTypeFiles = getChangeTypeFiles;
function* getAllChangeTypeFilesGenerator({ inputs, changedFiles }) { function* getAllChangeTypeFilesGenerator({ inputs, changedFiles }) {
@@ -181,9 +193,15 @@ const getAllChangeTypeFiles = ({ inputs, changedFiles }) => __awaiter(void 0, vo
...new Set(getAllChangeTypeFilesGenerator({ inputs, changedFiles })) ...new Set(getAllChangeTypeFilesGenerator({ inputs, changedFiles }))
]; ];
if (inputs.json) { if (inputs.json) {
return (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }); return {
paths: (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }),
count: files.length.toString()
};
} }
return files.join(inputs.separator); return {
paths: files.join(inputs.separator),
count: files.length.toString()
};
}); });
exports.getAllChangeTypeFiles = getAllChangeTypeFiles; exports.getAllChangeTypeFiles = getAllChangeTypeFiles;
@@ -235,12 +253,18 @@ const utils_1 = __nccwpck_require__(918);
const getOutputKey = (key, outputPrefix) => { const getOutputKey = (key, outputPrefix) => {
return outputPrefix ? `${outputPrefix}_${key}` : key; return outputPrefix ? `${outputPrefix}_${key}` : key;
}; };
const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], outputPrefix = '' }) => __awaiter(void 0, void 0, void 0, function* () { const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffResult, filePatterns = [], outputPrefix = '' }) => __awaiter(void 0, void 0, void 0, function* () {
const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({ const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({
allDiffFiles, allDiffFiles,
filePatterns filePatterns
}); });
core.debug(`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`); core.debug(`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`);
yield (0, utils_1.recoverDeletedFiles)({
inputs,
workingDirectory,
deletedFiles: allFilteredDiffFiles[changedFiles_1.ChangeTypeEnum.Deleted],
sha: diffResult.previousSha
});
const addedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const addedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
changedFiles: allFilteredDiffFiles, changedFiles: allFilteredDiffFiles,
@@ -249,7 +273,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`Added files: ${addedFiles}`); core.debug(`Added files: ${addedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('added_files', outputPrefix), key: getOutputKey('added_files', outputPrefix),
value: addedFiles, value: addedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('added_files_count', outputPrefix),
value: addedFiles.count,
inputs inputs
}); });
const copiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const copiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -260,7 +289,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`Copied files: ${copiedFiles}`); core.debug(`Copied files: ${copiedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('copied_files', outputPrefix), key: getOutputKey('copied_files', outputPrefix),
value: copiedFiles, value: copiedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('copied_files_count', outputPrefix),
value: copiedFiles.count,
inputs inputs
}); });
const modifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const modifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -271,7 +305,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`Modified files: ${modifiedFiles}`); core.debug(`Modified files: ${modifiedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('modified_files', outputPrefix), key: getOutputKey('modified_files', outputPrefix),
value: modifiedFiles, value: modifiedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('modified_files_count', outputPrefix),
value: modifiedFiles.count,
inputs inputs
}); });
const renamedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const renamedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -282,7 +321,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`Renamed files: ${renamedFiles}`); core.debug(`Renamed files: ${renamedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('renamed_files', outputPrefix), key: getOutputKey('renamed_files', outputPrefix),
value: renamedFiles, value: renamedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('renamed_files_count', outputPrefix),
value: renamedFiles.count,
inputs inputs
}); });
const typeChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const typeChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -293,7 +337,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`Type changed files: ${typeChangedFiles}`); core.debug(`Type changed files: ${typeChangedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('type_changed_files', outputPrefix), key: getOutputKey('type_changed_files', outputPrefix),
value: typeChangedFiles, value: typeChangedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('type_changed_files_count', outputPrefix),
value: typeChangedFiles.count,
inputs inputs
}); });
const unmergedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const unmergedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -304,7 +353,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`Unmerged files: ${unmergedFiles}`); core.debug(`Unmerged files: ${unmergedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('unmerged_files', outputPrefix), key: getOutputKey('unmerged_files', outputPrefix),
value: unmergedFiles, value: unmergedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('unmerged_files_count', outputPrefix),
value: unmergedFiles.count,
inputs inputs
}); });
const unknownFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const unknownFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -315,7 +369,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`Unknown files: ${unknownFiles}`); core.debug(`Unknown files: ${unknownFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('unknown_files', outputPrefix), key: getOutputKey('unknown_files', outputPrefix),
value: unknownFiles, value: unknownFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('unknown_files_count', outputPrefix),
value: unknownFiles.count,
inputs inputs
}); });
const allChangedAndModifiedFiles = yield (0, changedFiles_1.getAllChangeTypeFiles)({ const allChangedAndModifiedFiles = yield (0, changedFiles_1.getAllChangeTypeFiles)({
@@ -325,7 +384,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`); core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_and_modified_files', outputPrefix), key: getOutputKey('all_changed_and_modified_files', outputPrefix),
value: allChangedAndModifiedFiles, value: allChangedAndModifiedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_and_modified_files_count', outputPrefix),
value: allChangedAndModifiedFiles.count,
inputs inputs
}); });
const allChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -341,12 +405,17 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`All changed files: ${allChangedFiles}`); core.debug(`All changed files: ${allChangedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_files', outputPrefix), key: getOutputKey('all_changed_files', outputPrefix),
value: allChangedFiles, value: allChangedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_files_count', outputPrefix),
value: allChangedFiles.count,
inputs inputs
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('any_changed', outputPrefix), key: getOutputKey('any_changed', outputPrefix),
value: allChangedFiles.length > 0 && filePatterns.length > 0, value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
inputs inputs
}); });
const allOtherChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allOtherChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -360,11 +429,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
] ]
}); });
core.debug(`All other changed files: ${allOtherChangedFiles}`); core.debug(`All other changed files: ${allOtherChangedFiles}`);
const otherChangedFiles = allOtherChangedFiles const otherChangedFiles = allOtherChangedFiles.paths
.split(inputs.separator) .split(inputs.separator)
.filter((filePath) => !allChangedFiles.split(inputs.separator).includes(filePath)); .filter((filePath) => !allChangedFiles.paths.split(inputs.separator).includes(filePath));
const onlyChanged = otherChangedFiles.length === 0 && const onlyChanged = otherChangedFiles.length === 0 &&
allChangedFiles.length > 0 && allChangedFiles.paths.length > 0 &&
filePatterns.length > 0; filePatterns.length > 0;
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('only_changed', outputPrefix), key: getOutputKey('only_changed', outputPrefix),
@@ -376,6 +445,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
value: otherChangedFiles.join(inputs.separator), value: otherChangedFiles.join(inputs.separator),
inputs inputs
}); });
yield (0, utils_1.setOutput)({
key: getOutputKey('other_changed_files_count', outputPrefix),
value: otherChangedFiles.length.toString(),
inputs
});
const allModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
changedFiles: allFilteredDiffFiles, changedFiles: allFilteredDiffFiles,
@@ -390,12 +464,17 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`All modified files: ${allModifiedFiles}`); core.debug(`All modified files: ${allModifiedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('all_modified_files', outputPrefix), key: getOutputKey('all_modified_files', outputPrefix),
value: allModifiedFiles, value: allModifiedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('all_modified_files_count', outputPrefix),
value: allModifiedFiles.count,
inputs inputs
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('any_modified', outputPrefix), key: getOutputKey('any_modified', outputPrefix),
value: allModifiedFiles.length > 0 && filePatterns.length > 0, value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
inputs inputs
}); });
const allOtherModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allOtherModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -409,11 +488,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
changedFiles_1.ChangeTypeEnum.Deleted changedFiles_1.ChangeTypeEnum.Deleted
] ]
}); });
const otherModifiedFiles = allOtherModifiedFiles const otherModifiedFiles = allOtherModifiedFiles.paths
.split(inputs.separator) .split(inputs.separator)
.filter((filePath) => !allModifiedFiles.split(inputs.separator).includes(filePath)); .filter((filePath) => !allModifiedFiles.paths.split(inputs.separator).includes(filePath));
const onlyModified = otherModifiedFiles.length === 0 && const onlyModified = otherModifiedFiles.length === 0 &&
allModifiedFiles.length > 0 && allModifiedFiles.paths.length > 0 &&
filePatterns.length > 0; filePatterns.length > 0;
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('only_modified', outputPrefix), key: getOutputKey('only_modified', outputPrefix),
@@ -425,6 +504,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
value: otherModifiedFiles.join(inputs.separator), value: otherModifiedFiles.join(inputs.separator),
inputs inputs
}); });
yield (0, utils_1.setOutput)({
key: getOutputKey('other_modified_files_count', outputPrefix),
value: otherModifiedFiles.length.toString(),
inputs
});
const deletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const deletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
changedFiles: allFilteredDiffFiles, changedFiles: allFilteredDiffFiles,
@@ -433,12 +517,17 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
core.debug(`Deleted files: ${deletedFiles}`); core.debug(`Deleted files: ${deletedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('deleted_files', outputPrefix), key: getOutputKey('deleted_files', outputPrefix),
value: deletedFiles, value: deletedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: getOutputKey('deleted_files_count', outputPrefix),
value: deletedFiles.count,
inputs inputs
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('any_deleted', outputPrefix), key: getOutputKey('any_deleted', outputPrefix),
value: deletedFiles.length > 0 && filePatterns.length > 0, value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
inputs inputs
}); });
const allOtherDeletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allOtherDeletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
@@ -446,11 +535,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
changedFiles: allDiffFiles, changedFiles: allDiffFiles,
changeTypes: [changedFiles_1.ChangeTypeEnum.Deleted] changeTypes: [changedFiles_1.ChangeTypeEnum.Deleted]
}); });
const otherDeletedFiles = allOtherDeletedFiles const otherDeletedFiles = allOtherDeletedFiles.paths
.split(inputs.separator) .split(inputs.separator)
.filter(filePath => !deletedFiles.split(inputs.separator).includes(filePath)); .filter(filePath => !deletedFiles.paths.split(inputs.separator).includes(filePath));
const onlyDeleted = otherDeletedFiles.length === 0 && const onlyDeleted = otherDeletedFiles.length === 0 &&
deletedFiles.length > 0 && deletedFiles.paths.length > 0 &&
filePatterns.length > 0; filePatterns.length > 0;
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('only_deleted', outputPrefix), key: getOutputKey('only_deleted', outputPrefix),
@@ -462,6 +551,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, filePatterns = [], output
value: otherDeletedFiles.join(inputs.separator), value: otherDeletedFiles.join(inputs.separator),
inputs inputs
}); });
yield (0, utils_1.setOutput)({
key: getOutputKey('other_deleted_files_count', outputPrefix),
value: otherDeletedFiles.length.toString(),
inputs
});
}); });
exports.setChangedFilesOutput = setChangedFilesOutput; exports.setChangedFilesOutput = setChangedFilesOutput;
@@ -1073,6 +1167,10 @@ const getInputs = () => {
}); });
const outputDir = core.getInput('output_dir', { required: false }); const outputDir = core.getInput('output_dir', { required: false });
const outputRenamedFilesAsDeletedAndAdded = core.getBooleanInput('output_renamed_files_as_deleted_and_added', { required: false }); const outputRenamedFilesAsDeletedAndAdded = core.getBooleanInput('output_renamed_files_as_deleted_and_added', { required: false });
const recoverDeletedFiles = core.getBooleanInput('recover_deleted_files', {
required: false
});
const recoverDeletedFilesToDestination = core.getInput('recover_deleted_files_to_destination', { required: false });
const inputs = { const inputs = {
files, files,
filesSeparator, filesSeparator,
@@ -1107,7 +1205,9 @@ const getInputs = () => {
sinceLastRemoteCommit, sinceLastRemoteCommit,
writeOutputFiles, writeOutputFiles,
outputDir, outputDir,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded,
recoverDeletedFiles,
recoverDeletedFilesToDestination
}; };
if (fetchDepth) { if (fetchDepth) {
inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2); inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2);
@@ -1243,7 +1343,9 @@ function run() {
yield (0, changedFilesOutput_1.setChangedFilesOutput)({ yield (0, changedFilesOutput_1.setChangedFilesOutput)({
allDiffFiles, allDiffFiles,
filePatterns, filePatterns,
inputs inputs,
workingDirectory,
diffResult
}); });
core.info('All Done!'); core.info('All Done!');
core.endGroup(); core.endGroup();
@@ -1259,8 +1361,10 @@ function run() {
yield (0, changedFilesOutput_1.setChangedFilesOutput)({ yield (0, changedFilesOutput_1.setChangedFilesOutput)({
allDiffFiles, allDiffFiles,
filePatterns: yamlFilePatterns[key], filePatterns: yamlFilePatterns[key],
outputPrefix: key,
inputs, inputs,
outputPrefix: key workingDirectory,
diffResult
}); });
core.info('All Done!'); core.info('All Done!');
core.endGroup(); core.endGroup();
@@ -1270,7 +1374,9 @@ function run() {
core.startGroup('changed-files-all'); core.startGroup('changed-files-all');
yield (0, changedFilesOutput_1.setChangedFilesOutput)({ yield (0, changedFilesOutput_1.setChangedFilesOutput)({
allDiffFiles, allDiffFiles,
inputs inputs,
workingDirectory,
diffResult
}); });
core.info('All Done!'); core.info('All Done!');
core.endGroup(); core.endGroup();
@@ -1287,7 +1393,12 @@ function run() {
core.debug(`All old new renamed files: ${allOldNewRenamedFiles}`); core.debug(`All old new renamed files: ${allOldNewRenamedFiles}`);
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: 'all_old_new_renamed_files', key: 'all_old_new_renamed_files',
value: allOldNewRenamedFiles, value: allOldNewRenamedFiles.paths,
inputs
});
yield (0, utils_1.setOutput)({
key: 'all_old_new_renamed_files_count',
value: allOldNewRenamedFiles.count,
inputs inputs
}); });
core.info('All Done!'); core.info('All Done!');
@@ -1367,7 +1478,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.setOutput = exports.getYamlFilePatterns = exports.getFilePatterns = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.getRemoteBranchHeadSha = 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 = void 0; exports.recoverDeletedFiles = exports.setOutput = exports.getYamlFilePatterns = exports.getFilePatterns = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.getRemoteBranchHeadSha = 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 = 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));
@@ -1702,7 +1813,7 @@ const getAllChangedFiles = ({ cwd, sha1, sha2, diff, isSubmodule = false, parent
changedFiles[changedFiles_1.ChangeTypeEnum.Added].push(normalizedNewPath); changedFiles[changedFiles_1.ChangeTypeEnum.Added].push(normalizedNewPath);
} }
else { else {
changedFiles[changedFiles_1.ChangeTypeEnum.Renamed].push(normalizedFilePath); changedFiles[changedFiles_1.ChangeTypeEnum.Renamed].push(normalizedNewPath);
} }
} }
else { else {
@@ -2039,6 +2150,37 @@ const setOutput = ({ key, value, inputs }) => __awaiter(void 0, void 0, void 0,
} }
}); });
exports.setOutput = setOutput; exports.setOutput = setOutput;
const getDeletedFileContents = ({ cwd, filePath, sha }) => __awaiter(void 0, void 0, void 0, function* () {
const { stdout, exitCode, stderr } = yield exec.getExecOutput('git', ['show', `${sha}:${filePath}`], {
cwd,
silent: process.env.RUNNER_DEBUG !== '1',
ignoreReturnCode: true
});
if (exitCode !== 0) {
throw new Error(`Error getting file content from git history "${filePath}": ${stderr}`);
}
return stdout;
});
const recoverDeletedFiles = ({ inputs, workingDirectory, deletedFiles, sha }) => __awaiter(void 0, void 0, void 0, function* () {
if (inputs.recoverDeletedFiles) {
for (const deletedFile of deletedFiles) {
let target = path.join(workingDirectory, deletedFile);
if (inputs.recoverDeletedFilesToDestination) {
target = path.join(workingDirectory, inputs.recoverDeletedFilesToDestination, deletedFile);
}
const deletedFileContents = yield getDeletedFileContents({
cwd: workingDirectory,
filePath: deletedFile,
sha
});
if (!(yield exists(path.dirname(target)))) {
yield fs_1.promises.mkdir(path.dirname(target), { recursive: true });
}
yield fs_1.promises.writeFile(target, deletedFileContents);
}
}
});
exports.recoverDeletedFiles = recoverDeletedFiles;
/***/ }), /***/ }),

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -44,12 +44,12 @@
"@types/micromatch": "^4.0.2", "@types/micromatch": "^4.0.2",
"@types/node": "20.2.1", "@types/node": "20.2.1",
"@types/uuid": "9.0.2", "@types/uuid": "9.0.2",
"@typescript-eslint/eslint-plugin": "5.59.11", "@typescript-eslint/eslint-plugin": "5.60.0",
"@typescript-eslint/parser": "5.59.11", "@typescript-eslint/parser": "5.60.0",
"@vercel/ncc": "0.36.1", "@vercel/ncc": "0.36.1",
"eslint": "8.42.0", "eslint": "8.43.0",
"eslint-plugin-github": "4.8.0", "eslint-plugin-github": "4.8.0",
"eslint-plugin-jest": "27.2.1", "eslint-plugin-jest": "27.2.2",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"jest": "29.5.0", "jest": "29.5.0",
"prettier": "2.8.8", "prettier": "2.8.8",

View File

@@ -23,7 +23,7 @@ export const getRenamedFiles = async ({
hasSubmodule: boolean hasSubmodule: boolean
diffResult: DiffResult diffResult: DiffResult
submodulePaths: string[] submodulePaths: string[]
}): Promise<string> => { }): Promise<{paths: string; count: string}> => {
const renamedFiles = await gitRenamedFiles({ const renamedFiles = await gitRenamedFiles({
cwd: workingDirectory, cwd: workingDirectory,
sha1: diffResult.previousSha, sha1: diffResult.previousSha,
@@ -63,10 +63,16 @@ export const getRenamedFiles = async ({
} }
if (inputs.json) { if (inputs.json) {
return jsonOutput({value: renamedFiles, shouldEscape: inputs.escapeJson}) return {
paths: jsonOutput({value: renamedFiles, shouldEscape: inputs.escapeJson}),
count: renamedFiles.length.toString()
}
} }
return renamedFiles.join(inputs.oldNewFilesSeparator) return {
paths: renamedFiles.join(inputs.oldNewFilesSeparator),
count: renamedFiles.length.toString()
}
} }
export enum ChangeTypeEnum { export enum ChangeTypeEnum {
@@ -180,16 +186,22 @@ export const getChangeTypeFiles = async ({
inputs: Inputs inputs: Inputs
changedFiles: ChangedFiles changedFiles: ChangedFiles
changeTypes: ChangeTypeEnum[] changeTypes: ChangeTypeEnum[]
}): Promise<string> => { }): Promise<{paths: string; count: string}> => {
const files = [ const files = [
...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes})) ...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes}))
] ]
if (inputs.json) { if (inputs.json) {
return jsonOutput({value: files, shouldEscape: inputs.escapeJson}) return {
paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}),
count: files.length.toString()
}
} }
return files.join(inputs.separator) return {
paths: files.join(inputs.separator),
count: files.length.toString()
}
} }
function* getAllChangeTypeFilesGenerator({ function* getAllChangeTypeFilesGenerator({
@@ -219,14 +231,20 @@ export const getAllChangeTypeFiles = async ({
}: { }: {
inputs: Inputs inputs: Inputs
changedFiles: ChangedFiles changedFiles: ChangedFiles
}): Promise<string> => { }): Promise<{paths: string; count: string}> => {
const files = [ const files = [
...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles})) ...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles}))
] ]
if (inputs.json) { if (inputs.json) {
return jsonOutput({value: files, shouldEscape: inputs.escapeJson}) return {
paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}),
count: files.length.toString()
}
} }
return files.join(inputs.separator) return {
paths: files.join(inputs.separator),
count: files.length.toString()
}
} }

View File

@@ -5,8 +5,9 @@ import {
getAllChangeTypeFiles, getAllChangeTypeFiles,
getChangeTypeFiles getChangeTypeFiles
} from './changedFiles' } from './changedFiles'
import {DiffResult} from './commitSha'
import {Inputs} from './inputs' import {Inputs} from './inputs'
import {getFilteredChangedFiles, setOutput} from './utils' import {getFilteredChangedFiles, recoverDeletedFiles, setOutput} from './utils'
const getOutputKey = (key: string, outputPrefix: string): string => { const getOutputKey = (key: string, outputPrefix: string): string => {
return outputPrefix ? `${outputPrefix}_${key}` : key return outputPrefix ? `${outputPrefix}_${key}` : key
@@ -15,12 +16,16 @@ const getOutputKey = (key: string, outputPrefix: string): string => {
export const setChangedFilesOutput = async ({ export const setChangedFilesOutput = async ({
allDiffFiles, allDiffFiles,
inputs, inputs,
workingDirectory,
diffResult,
filePatterns = [], filePatterns = [],
outputPrefix = '' outputPrefix = ''
}: { }: {
allDiffFiles: ChangedFiles allDiffFiles: ChangedFiles
filePatterns?: string[] filePatterns?: string[]
inputs: Inputs inputs: Inputs
workingDirectory: string
diffResult: DiffResult
outputPrefix?: string outputPrefix?: string
}): Promise<void> => { }): Promise<void> => {
const allFilteredDiffFiles = await getFilteredChangedFiles({ const allFilteredDiffFiles = await getFilteredChangedFiles({
@@ -29,6 +34,13 @@ export const setChangedFilesOutput = async ({
}) })
core.debug(`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`) core.debug(`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`)
await recoverDeletedFiles({
inputs,
workingDirectory,
deletedFiles: allFilteredDiffFiles[ChangeTypeEnum.Deleted],
sha: diffResult.previousSha
})
const addedFiles = await getChangeTypeFiles({ const addedFiles = await getChangeTypeFiles({
inputs, inputs,
changedFiles: allFilteredDiffFiles, changedFiles: allFilteredDiffFiles,
@@ -37,7 +49,12 @@ export const setChangedFilesOutput = async ({
core.debug(`Added files: ${addedFiles}`) core.debug(`Added files: ${addedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('added_files', outputPrefix), key: getOutputKey('added_files', outputPrefix),
value: addedFiles, value: addedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('added_files_count', outputPrefix),
value: addedFiles.count,
inputs inputs
}) })
@@ -49,7 +66,13 @@ export const setChangedFilesOutput = async ({
core.debug(`Copied files: ${copiedFiles}`) core.debug(`Copied files: ${copiedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('copied_files', outputPrefix), key: getOutputKey('copied_files', outputPrefix),
value: copiedFiles, value: copiedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('copied_files_count', outputPrefix),
value: copiedFiles.count,
inputs inputs
}) })
@@ -61,7 +84,13 @@ export const setChangedFilesOutput = async ({
core.debug(`Modified files: ${modifiedFiles}`) core.debug(`Modified files: ${modifiedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('modified_files', outputPrefix), key: getOutputKey('modified_files', outputPrefix),
value: modifiedFiles, value: modifiedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('modified_files_count', outputPrefix),
value: modifiedFiles.count,
inputs inputs
}) })
@@ -73,7 +102,13 @@ export const setChangedFilesOutput = async ({
core.debug(`Renamed files: ${renamedFiles}`) core.debug(`Renamed files: ${renamedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('renamed_files', outputPrefix), key: getOutputKey('renamed_files', outputPrefix),
value: renamedFiles, value: renamedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('renamed_files_count', outputPrefix),
value: renamedFiles.count,
inputs inputs
}) })
@@ -85,7 +120,13 @@ export const setChangedFilesOutput = async ({
core.debug(`Type changed files: ${typeChangedFiles}`) core.debug(`Type changed files: ${typeChangedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('type_changed_files', outputPrefix), key: getOutputKey('type_changed_files', outputPrefix),
value: typeChangedFiles, value: typeChangedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('type_changed_files_count', outputPrefix),
value: typeChangedFiles.count,
inputs inputs
}) })
@@ -97,7 +138,13 @@ export const setChangedFilesOutput = async ({
core.debug(`Unmerged files: ${unmergedFiles}`) core.debug(`Unmerged files: ${unmergedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('unmerged_files', outputPrefix), key: getOutputKey('unmerged_files', outputPrefix),
value: unmergedFiles, value: unmergedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('unmerged_files_count', outputPrefix),
value: unmergedFiles.count,
inputs inputs
}) })
@@ -109,7 +156,13 @@ export const setChangedFilesOutput = async ({
core.debug(`Unknown files: ${unknownFiles}`) core.debug(`Unknown files: ${unknownFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('unknown_files', outputPrefix), key: getOutputKey('unknown_files', outputPrefix),
value: unknownFiles, value: unknownFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('unknown_files_count', outputPrefix),
value: unknownFiles.count,
inputs inputs
}) })
@@ -120,7 +173,13 @@ export const setChangedFilesOutput = async ({
core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`) core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('all_changed_and_modified_files', outputPrefix), key: getOutputKey('all_changed_and_modified_files', outputPrefix),
value: allChangedAndModifiedFiles, value: allChangedAndModifiedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('all_changed_and_modified_files_count', outputPrefix),
value: allChangedAndModifiedFiles.count,
inputs inputs
}) })
@@ -137,13 +196,19 @@ export const setChangedFilesOutput = async ({
core.debug(`All changed files: ${allChangedFiles}`) core.debug(`All changed files: ${allChangedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('all_changed_files', outputPrefix), key: getOutputKey('all_changed_files', outputPrefix),
value: allChangedFiles, value: allChangedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('all_changed_files_count', outputPrefix),
value: allChangedFiles.count,
inputs inputs
}) })
await setOutput({ await setOutput({
key: getOutputKey('any_changed', outputPrefix), key: getOutputKey('any_changed', outputPrefix),
value: allChangedFiles.length > 0 && filePatterns.length > 0, value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
inputs inputs
}) })
@@ -159,16 +224,16 @@ export const setChangedFilesOutput = async ({
}) })
core.debug(`All other changed files: ${allOtherChangedFiles}`) core.debug(`All other changed files: ${allOtherChangedFiles}`)
const otherChangedFiles = allOtherChangedFiles const otherChangedFiles = allOtherChangedFiles.paths
.split(inputs.separator) .split(inputs.separator)
.filter( .filter(
(filePath: string) => (filePath: string) =>
!allChangedFiles.split(inputs.separator).includes(filePath) !allChangedFiles.paths.split(inputs.separator).includes(filePath)
) )
const onlyChanged = const onlyChanged =
otherChangedFiles.length === 0 && otherChangedFiles.length === 0 &&
allChangedFiles.length > 0 && allChangedFiles.paths.length > 0 &&
filePatterns.length > 0 filePatterns.length > 0
await setOutput({ await setOutput({
@@ -183,6 +248,12 @@ export const setChangedFilesOutput = async ({
inputs inputs
}) })
await setOutput({
key: getOutputKey('other_changed_files_count', outputPrefix),
value: otherChangedFiles.length.toString(),
inputs
})
const allModifiedFiles = await getChangeTypeFiles({ const allModifiedFiles = await getChangeTypeFiles({
inputs, inputs,
changedFiles: allFilteredDiffFiles, changedFiles: allFilteredDiffFiles,
@@ -197,13 +268,19 @@ export const setChangedFilesOutput = async ({
core.debug(`All modified files: ${allModifiedFiles}`) core.debug(`All modified files: ${allModifiedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('all_modified_files', outputPrefix), key: getOutputKey('all_modified_files', outputPrefix),
value: allModifiedFiles, value: allModifiedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('all_modified_files_count', outputPrefix),
value: allModifiedFiles.count,
inputs inputs
}) })
await setOutput({ await setOutput({
key: getOutputKey('any_modified', outputPrefix), key: getOutputKey('any_modified', outputPrefix),
value: allModifiedFiles.length > 0 && filePatterns.length > 0, value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
inputs inputs
}) })
@@ -219,16 +296,16 @@ export const setChangedFilesOutput = async ({
] ]
}) })
const otherModifiedFiles = allOtherModifiedFiles const otherModifiedFiles = allOtherModifiedFiles.paths
.split(inputs.separator) .split(inputs.separator)
.filter( .filter(
(filePath: string) => (filePath: string) =>
!allModifiedFiles.split(inputs.separator).includes(filePath) !allModifiedFiles.paths.split(inputs.separator).includes(filePath)
) )
const onlyModified = const onlyModified =
otherModifiedFiles.length === 0 && otherModifiedFiles.length === 0 &&
allModifiedFiles.length > 0 && allModifiedFiles.paths.length > 0 &&
filePatterns.length > 0 filePatterns.length > 0
await setOutput({ await setOutput({
@@ -243,6 +320,12 @@ export const setChangedFilesOutput = async ({
inputs inputs
}) })
await setOutput({
key: getOutputKey('other_modified_files_count', outputPrefix),
value: otherModifiedFiles.length.toString(),
inputs
})
const deletedFiles = await getChangeTypeFiles({ const deletedFiles = await getChangeTypeFiles({
inputs, inputs,
changedFiles: allFilteredDiffFiles, changedFiles: allFilteredDiffFiles,
@@ -251,13 +334,19 @@ export const setChangedFilesOutput = async ({
core.debug(`Deleted files: ${deletedFiles}`) core.debug(`Deleted files: ${deletedFiles}`)
await setOutput({ await setOutput({
key: getOutputKey('deleted_files', outputPrefix), key: getOutputKey('deleted_files', outputPrefix),
value: deletedFiles, value: deletedFiles.paths,
inputs
})
await setOutput({
key: getOutputKey('deleted_files_count', outputPrefix),
value: deletedFiles.count,
inputs inputs
}) })
await setOutput({ await setOutput({
key: getOutputKey('any_deleted', outputPrefix), key: getOutputKey('any_deleted', outputPrefix),
value: deletedFiles.length > 0 && filePatterns.length > 0, value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
inputs inputs
}) })
@@ -267,15 +356,15 @@ export const setChangedFilesOutput = async ({
changeTypes: [ChangeTypeEnum.Deleted] changeTypes: [ChangeTypeEnum.Deleted]
}) })
const otherDeletedFiles = allOtherDeletedFiles const otherDeletedFiles = allOtherDeletedFiles.paths
.split(inputs.separator) .split(inputs.separator)
.filter( .filter(
filePath => !deletedFiles.split(inputs.separator).includes(filePath) filePath => !deletedFiles.paths.split(inputs.separator).includes(filePath)
) )
const onlyDeleted = const onlyDeleted =
otherDeletedFiles.length === 0 && otherDeletedFiles.length === 0 &&
deletedFiles.length > 0 && deletedFiles.paths.length > 0 &&
filePatterns.length > 0 filePatterns.length > 0
await setOutput({ await setOutput({
@@ -289,4 +378,10 @@ export const setChangedFilesOutput = async ({
value: otherDeletedFiles.join(inputs.separator), value: otherDeletedFiles.join(inputs.separator),
inputs inputs
}) })
await setOutput({
key: getOutputKey('other_deleted_files_count', outputPrefix),
value: otherDeletedFiles.length.toString(),
inputs
})
} }

View File

@@ -37,6 +37,8 @@ export type Inputs = {
writeOutputFiles: boolean writeOutputFiles: boolean
outputDir: string outputDir: string
outputRenamedFilesAsDeletedAndAdded: boolean outputRenamedFilesAsDeletedAndAdded: boolean
recoverDeletedFiles: boolean
recoverDeletedFilesToDestination: string
} }
export const getInputs = (): Inputs => { export const getInputs = (): Inputs => {
@@ -145,6 +147,13 @@ export const getInputs = (): Inputs => {
'output_renamed_files_as_deleted_and_added', 'output_renamed_files_as_deleted_and_added',
{required: false} {required: false}
) )
const recoverDeletedFiles = core.getBooleanInput('recover_deleted_files', {
required: false
})
const recoverDeletedFilesToDestination = core.getInput(
'recover_deleted_files_to_destination',
{required: false}
)
const inputs: Inputs = { const inputs: Inputs = {
files, files,
@@ -180,7 +189,9 @@ export const getInputs = (): Inputs => {
sinceLastRemoteCommit, sinceLastRemoteCommit,
writeOutputFiles, writeOutputFiles,
outputDir, outputDir,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded,
recoverDeletedFiles,
recoverDeletedFilesToDestination
} }
if (fetchDepth) { if (fetchDepth) {

View File

@@ -129,7 +129,9 @@ export async function run(): Promise<void> {
await setChangedFilesOutput({ await setChangedFilesOutput({
allDiffFiles, allDiffFiles,
filePatterns, filePatterns,
inputs inputs,
workingDirectory,
diffResult
}) })
core.info('All Done!') core.info('All Done!')
core.endGroup() core.endGroup()
@@ -147,8 +149,10 @@ export async function run(): Promise<void> {
await setChangedFilesOutput({ await setChangedFilesOutput({
allDiffFiles, allDiffFiles,
filePatterns: yamlFilePatterns[key], filePatterns: yamlFilePatterns[key],
outputPrefix: key,
inputs, inputs,
outputPrefix: key workingDirectory,
diffResult
}) })
core.info('All Done!') core.info('All Done!')
core.endGroup() core.endGroup()
@@ -159,7 +163,9 @@ export async function run(): Promise<void> {
core.startGroup('changed-files-all') core.startGroup('changed-files-all')
await setChangedFilesOutput({ await setChangedFilesOutput({
allDiffFiles, allDiffFiles,
inputs inputs,
workingDirectory,
diffResult
}) })
core.info('All Done!') core.info('All Done!')
core.endGroup() core.endGroup()
@@ -177,7 +183,12 @@ export async function run(): Promise<void> {
core.debug(`All old new renamed files: ${allOldNewRenamedFiles}`) core.debug(`All old new renamed files: ${allOldNewRenamedFiles}`)
await setOutput({ await setOutput({
key: 'all_old_new_renamed_files', key: 'all_old_new_renamed_files',
value: allOldNewRenamedFiles, value: allOldNewRenamedFiles.paths,
inputs
})
await setOutput({
key: 'all_old_new_renamed_files_count',
value: allOldNewRenamedFiles.count,
inputs inputs
}) })
core.info('All Done!') core.info('All Done!')

View File

@@ -484,7 +484,7 @@ export const getAllChangedFiles = async ({
changedFiles[ChangeTypeEnum.Deleted].push(normalizedFilePath) changedFiles[ChangeTypeEnum.Deleted].push(normalizedFilePath)
changedFiles[ChangeTypeEnum.Added].push(normalizedNewPath) changedFiles[ChangeTypeEnum.Added].push(normalizedNewPath)
} else { } else {
changedFiles[ChangeTypeEnum.Renamed].push(normalizedFilePath) changedFiles[ChangeTypeEnum.Renamed].push(normalizedNewPath)
} }
} else { } else {
changedFiles[changeType as ChangeTypeEnum].push(normalizedFilePath) changedFiles[changeType as ChangeTypeEnum].push(normalizedFilePath)
@@ -1032,3 +1032,68 @@ export const setOutput = async ({
await fs.writeFile(outputFilePath, cleanedValue.replace(/\\"/g, '"')) await fs.writeFile(outputFilePath, cleanedValue.replace(/\\"/g, '"'))
} }
} }
const getDeletedFileContents = async ({
cwd,
filePath,
sha
}: {
cwd: string
filePath: string
sha: string
}): Promise<string> => {
const {stdout, exitCode, stderr} = await exec.getExecOutput(
'git',
['show', `${sha}:${filePath}`],
{
cwd,
silent: process.env.RUNNER_DEBUG !== '1',
ignoreReturnCode: true
}
)
if (exitCode !== 0) {
throw new Error(
`Error getting file content from git history "${filePath}": ${stderr}`
)
}
return stdout
}
export const recoverDeletedFiles = async ({
inputs,
workingDirectory,
deletedFiles,
sha
}: {
inputs: Inputs
workingDirectory: string
deletedFiles: string[]
sha: string
}): Promise<void> => {
if (inputs.recoverDeletedFiles) {
for (const deletedFile of deletedFiles) {
let target = path.join(workingDirectory, deletedFile)
if (inputs.recoverDeletedFilesToDestination) {
target = path.join(
workingDirectory,
inputs.recoverDeletedFilesToDestination,
deletedFile
)
}
const deletedFileContents = await getDeletedFileContents({
cwd: workingDirectory,
filePath: deletedFile,
sha
})
if (!(await exists(path.dirname(target)))) {
await fs.mkdir(path.dirname(target), {recursive: true})
}
await fs.writeFile(target, deletedFileContents)
}
}
}

152
yarn.lock
View File

@@ -360,10 +360,10 @@
minimatch "^3.1.2" minimatch "^3.1.2"
strip-json-comments "^3.1.1" strip-json-comments "^3.1.1"
"@eslint/js@8.42.0": "@eslint/js@8.43.0":
version "8.42.0" version "8.43.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.42.0.tgz#484a1d638de2911e6f5a30c12f49c7e4a3270fb6" resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.43.0.tgz#559ca3d9ddbd6bf907ad524320a0d14b85586af0"
integrity sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw== integrity sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==
"@github/browserslist-config@^1.0.0": "@github/browserslist-config@^1.0.0":
version "1.0.0" version "1.0.0"
@@ -810,7 +810,23 @@
dependencies: dependencies:
"@types/yargs-parser" "*" "@types/yargs-parser" "*"
"@typescript-eslint/eslint-plugin@5.59.11", "@typescript-eslint/eslint-plugin@^5.1.0": "@typescript-eslint/eslint-plugin@5.60.0":
version "5.60.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.60.0.tgz#2f4bea6a3718bed2ba52905358d0f45cd3620d31"
integrity sha512-78B+anHLF1TI8Jn/cD0Q00TBYdMgjdOn980JfAVa9yw5sop8nyTfVOQAv6LWywkOGLclDBtv5z3oxN4w7jxyNg==
dependencies:
"@eslint-community/regexpp" "^4.4.0"
"@typescript-eslint/scope-manager" "5.60.0"
"@typescript-eslint/type-utils" "5.60.0"
"@typescript-eslint/utils" "5.60.0"
debug "^4.3.4"
grapheme-splitter "^1.0.4"
ignore "^5.2.0"
natural-compare-lite "^1.4.0"
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/eslint-plugin@^5.1.0":
version "5.59.11" version "5.59.11"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.11.tgz#8d466aa21abea4c3f37129997b198d141f09e76f" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.11.tgz#8d466aa21abea4c3f37129997b198d141f09e76f"
integrity sha512-XxuOfTkCUiOSyBWIvHlUraLw/JT/6Io1365RO6ZuI88STKMavJZPNMU0lFcUTeQXEhHiv64CbxYxBNoDVSmghg== integrity sha512-XxuOfTkCUiOSyBWIvHlUraLw/JT/6Io1365RO6ZuI88STKMavJZPNMU0lFcUTeQXEhHiv64CbxYxBNoDVSmghg==
@@ -826,7 +842,17 @@
semver "^7.3.7" semver "^7.3.7"
tsutils "^3.21.0" tsutils "^3.21.0"
"@typescript-eslint/parser@5.59.11", "@typescript-eslint/parser@^5.1.0": "@typescript-eslint/parser@5.60.0":
version "5.60.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.60.0.tgz#08f4daf5fc6548784513524f4f2f359cebb4068a"
integrity sha512-jBONcBsDJ9UoTWrARkRRCgDz6wUggmH5RpQVlt7BimSwaTkTjwypGzKORXbR4/2Hqjk9hgwlon2rVQAjWNpkyQ==
dependencies:
"@typescript-eslint/scope-manager" "5.60.0"
"@typescript-eslint/types" "5.60.0"
"@typescript-eslint/typescript-estree" "5.60.0"
debug "^4.3.4"
"@typescript-eslint/parser@^5.1.0":
version "5.59.11" version "5.59.11"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.11.tgz#af7d4b7110e3068ce0b97550736de455e4250103" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.11.tgz#af7d4b7110e3068ce0b97550736de455e4250103"
integrity sha512-s9ZF3M+Nym6CAZEkJJeO2TFHHDsKAM3ecNkLuH4i4s8/RCPnF5JRip2GyviYkeEAcwGMJxkqG9h2dAsnA1nZpA== integrity sha512-s9ZF3M+Nym6CAZEkJJeO2TFHHDsKAM3ecNkLuH4i4s8/RCPnF5JRip2GyviYkeEAcwGMJxkqG9h2dAsnA1nZpA==
@@ -844,6 +870,14 @@
"@typescript-eslint/types" "5.59.11" "@typescript-eslint/types" "5.59.11"
"@typescript-eslint/visitor-keys" "5.59.11" "@typescript-eslint/visitor-keys" "5.59.11"
"@typescript-eslint/scope-manager@5.60.0":
version "5.60.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.60.0.tgz#ae511967b4bd84f1d5e179bb2c82857334941c1c"
integrity sha512-hakuzcxPwXi2ihf9WQu1BbRj1e/Pd8ZZwVTG9kfbxAMZstKz8/9OoexIwnmLzShtsdap5U/CoQGRCWlSuPbYxQ==
dependencies:
"@typescript-eslint/types" "5.60.0"
"@typescript-eslint/visitor-keys" "5.60.0"
"@typescript-eslint/type-utils@5.59.11": "@typescript-eslint/type-utils@5.59.11":
version "5.59.11" version "5.59.11"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.11.tgz#5eb67121808a84cb57d65a15f48f5bdda25f2346" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.11.tgz#5eb67121808a84cb57d65a15f48f5bdda25f2346"
@@ -854,11 +888,26 @@
debug "^4.3.4" debug "^4.3.4"
tsutils "^3.21.0" tsutils "^3.21.0"
"@typescript-eslint/type-utils@5.60.0":
version "5.60.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.60.0.tgz#69b09087eb12d7513d5b07747e7d47f5533aa228"
integrity sha512-X7NsRQddORMYRFH7FWo6sA9Y/zbJ8s1x1RIAtnlj6YprbToTiQnM6vxcMu7iYhdunmoC0rUWlca13D5DVHkK2g==
dependencies:
"@typescript-eslint/typescript-estree" "5.60.0"
"@typescript-eslint/utils" "5.60.0"
debug "^4.3.4"
tsutils "^3.21.0"
"@typescript-eslint/types@5.59.11": "@typescript-eslint/types@5.59.11":
version "5.59.11" version "5.59.11"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.11.tgz#1a9018fe3c565ba6969561f2a49f330cf1fe8db1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.11.tgz#1a9018fe3c565ba6969561f2a49f330cf1fe8db1"
integrity sha512-epoN6R6tkvBYSc+cllrz+c2sOFWkbisJZWkOE+y3xHtvYaOE6Wk6B8e114McRJwFRjGvYdJwLXQH5c9osME/AA== integrity sha512-epoN6R6tkvBYSc+cllrz+c2sOFWkbisJZWkOE+y3xHtvYaOE6Wk6B8e114McRJwFRjGvYdJwLXQH5c9osME/AA==
"@typescript-eslint/types@5.60.0":
version "5.60.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.60.0.tgz#3179962b28b4790de70e2344465ec97582ce2558"
integrity sha512-ascOuoCpNZBccFVNJRSC6rPq4EmJ2NkuoKnd6LDNyAQmdDnziAtxbCGWCbefG1CNzmDvd05zO36AmB7H8RzKPA==
"@typescript-eslint/typescript-estree@5.59.11": "@typescript-eslint/typescript-estree@5.59.11":
version "5.59.11" version "5.59.11"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.11.tgz#b2caaa31725e17c33970c1197bcd54e3c5f42b9f" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.11.tgz#b2caaa31725e17c33970c1197bcd54e3c5f42b9f"
@@ -872,6 +921,19 @@
semver "^7.3.7" semver "^7.3.7"
tsutils "^3.21.0" tsutils "^3.21.0"
"@typescript-eslint/typescript-estree@5.60.0":
version "5.60.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.0.tgz#4ddf1a81d32a850de66642d9b3ad1e3254fb1600"
integrity sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==
dependencies:
"@typescript-eslint/types" "5.60.0"
"@typescript-eslint/visitor-keys" "5.60.0"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/utils@5.59.11", "@typescript-eslint/utils@^5.10.0": "@typescript-eslint/utils@5.59.11", "@typescript-eslint/utils@^5.10.0":
version "5.59.11" version "5.59.11"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.11.tgz#9dbff49dc80bfdd9289f9f33548f2e8db3c59ba1" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.11.tgz#9dbff49dc80bfdd9289f9f33548f2e8db3c59ba1"
@@ -886,6 +948,20 @@
eslint-scope "^5.1.1" eslint-scope "^5.1.1"
semver "^7.3.7" semver "^7.3.7"
"@typescript-eslint/utils@5.60.0":
version "5.60.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.60.0.tgz#4667c5aece82f9d4f24a667602f0f300864b554c"
integrity sha512-ba51uMqDtfLQ5+xHtwlO84vkdjrqNzOnqrnwbMHMRY8Tqeme8C2Q8Fc7LajfGR+e3/4LoYiWXUM6BpIIbHJ4hQ==
dependencies:
"@eslint-community/eslint-utils" "^4.2.0"
"@types/json-schema" "^7.0.9"
"@types/semver" "^7.3.12"
"@typescript-eslint/scope-manager" "5.60.0"
"@typescript-eslint/types" "5.60.0"
"@typescript-eslint/typescript-estree" "5.60.0"
eslint-scope "^5.1.1"
semver "^7.3.7"
"@typescript-eslint/visitor-keys@5.59.11": "@typescript-eslint/visitor-keys@5.59.11":
version "5.59.11" version "5.59.11"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.11.tgz#dca561ddad169dc27d62396d64f45b2d2c3ecc56" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.11.tgz#dca561ddad169dc27d62396d64f45b2d2c3ecc56"
@@ -894,6 +970,14 @@
"@typescript-eslint/types" "5.59.11" "@typescript-eslint/types" "5.59.11"
eslint-visitor-keys "^3.3.0" eslint-visitor-keys "^3.3.0"
"@typescript-eslint/visitor-keys@5.60.0":
version "5.60.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.0.tgz#b48b29da3f5f31dd1656281727004589d2722a66"
integrity sha512-wm9Uz71SbCyhUKgcaPRauBdTegUyY/ZWl8gLwD/i/ybJqscrrdVSFImpvUz16BLPChIeKBK5Fa9s6KDQjsjyWw==
dependencies:
"@typescript-eslint/types" "5.60.0"
eslint-visitor-keys "^3.3.0"
"@vercel/ncc@0.36.1": "@vercel/ncc@0.36.1":
version "0.36.1" version "0.36.1"
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.36.1.tgz#d4c01fdbbe909d128d1bf11c7f8b5431654c5b95" resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.36.1.tgz#d4c01fdbbe909d128d1bf11c7f8b5431654c5b95"
@@ -905,9 +989,9 @@ acorn-jsx@^5.3.2:
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
acorn@^8.8.0: acorn@^8.8.0:
version "8.8.2" version "8.9.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.9.0.tgz#78a16e3b2bcc198c10822786fa6679e245db5b59"
integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==
ajv@^6.10.0, ajv@^6.12.4: ajv@^6.10.0, ajv@^6.12.4:
version "6.12.6" version "6.12.6"
@@ -1124,12 +1208,12 @@ braces@^3.0.2:
fill-range "^7.0.1" fill-range "^7.0.1"
browserslist@^4.21.0, browserslist@^4.21.3: browserslist@^4.21.0, browserslist@^4.21.3:
version "4.21.8" version "4.21.9"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.8.tgz#db2498e1f4b80ed199c076248a094935860b6017" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635"
integrity sha512-j+7xYe+v+q2Id9qbBeCI8WX5NmZSRe8es1+0xntD/+gaWXznP8tFEkv5IgSaHf5dS1YwVMbX/4W6m937mj+wQw== integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==
dependencies: dependencies:
caniuse-lite "^1.0.30001502" caniuse-lite "^1.0.30001503"
electron-to-chromium "^1.4.428" electron-to-chromium "^1.4.431"
node-releases "^2.0.12" node-releases "^2.0.12"
update-browserslist-db "^1.0.11" update-browserslist-db "^1.0.11"
@@ -1175,10 +1259,10 @@ camelcase@^6.2.0:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
caniuse-lite@^1.0.30001502: caniuse-lite@^1.0.30001503:
version "1.0.30001503" version "1.0.30001504"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001503.tgz#88b6ff1b2cf735f1f3361dc1a15b59f0561aa398" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001504.tgz#eaf77e5c852dfa5f82c4924468c30602ac53744a"
integrity sha512-Sf9NiF+wZxPfzv8Z3iS0rXM1Do+iOy2Lxvib38glFX+08TCYYYGR5fRJXk4d77C4AYwhUjgYgMsMudbh2TqCKw== integrity sha512-5uo7eoOp2mKbWyfMXnGO9rJWOGU8duvzEiYITW+wivukL7yHH4gX9yuRaobu6El4jPxo6jKZfG+N6fB621GD/Q==
chalk@^2.0.0: chalk@^2.0.0:
version "2.4.2" version "2.4.2"
@@ -1357,10 +1441,10 @@ doctrine@^3.0.0:
dependencies: dependencies:
esutils "^2.0.2" esutils "^2.0.2"
electron-to-chromium@^1.4.428: electron-to-chromium@^1.4.431:
version "1.4.430" version "1.4.433"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.430.tgz#52693c812a81800fafb5b312c1a850142e2fc9eb" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.433.tgz#305ef5f8ea5fe65d252aae4b0e1088f9e4842533"
integrity sha512-FytjTbGwz///F+ToZ5XSeXbbSaXalsVRXsz2mHityI5gfxft7ieW3HqFLkU5V1aIrY42aflICqbmFoDxW10etg== integrity sha512-MGO1k0w1RgrfdbLVwmXcDhHHuxCn2qRgR7dYsJvWFKDttvYPx6FNzCGG0c/fBBvzK2LDh3UV7Tt9awnHnvAAUQ==
emittery@^0.13.1: emittery@^0.13.1:
version "0.13.1" version "0.13.1"
@@ -1564,10 +1648,10 @@ eslint-plugin-import@^2.25.2:
semver "^6.3.0" semver "^6.3.0"
tsconfig-paths "^3.14.1" tsconfig-paths "^3.14.1"
eslint-plugin-jest@27.2.1: eslint-plugin-jest@27.2.2:
version "27.2.1" version "27.2.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.2.1.tgz#b85b4adf41c682ea29f1f01c8b11ccc39b5c672c" resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.2.2.tgz#be4ded5f91905d9ec89aa8968d39c71f3b072c0c"
integrity sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg== integrity sha512-euzbp06F934Z7UDl5ZUaRPLAc9MKjh0rMPERrHT7UhlCEwgb25kBj37TvMgWeHZVkR5I9CayswrpoaqZU1RImw==
dependencies: dependencies:
"@typescript-eslint/utils" "^5.10.0" "@typescript-eslint/utils" "^5.10.0"
@@ -1631,15 +1715,15 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994"
integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==
eslint@8.42.0: eslint@8.43.0:
version "8.42.0" version "8.43.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.42.0.tgz#7bebdc3a55f9ed7167251fe7259f75219cade291" resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.43.0.tgz#3e8c6066a57097adfd9d390b8fc93075f257a094"
integrity sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A== integrity sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q==
dependencies: dependencies:
"@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/eslint-utils" "^4.2.0"
"@eslint-community/regexpp" "^4.4.0" "@eslint-community/regexpp" "^4.4.0"
"@eslint/eslintrc" "^2.0.3" "@eslint/eslintrc" "^2.0.3"
"@eslint/js" "8.42.0" "@eslint/js" "8.43.0"
"@humanwhocodes/config-array" "^0.11.10" "@humanwhocodes/config-array" "^0.11.10"
"@humanwhocodes/module-importer" "^1.0.1" "@humanwhocodes/module-importer" "^1.0.1"
"@nodelib/fs.walk" "^1.2.8" "@nodelib/fs.walk" "^1.2.8"
@@ -3205,9 +3289,9 @@ safe-regex-test@^1.0.0:
is-regex "^1.1.4" is-regex "^1.1.4"
semver@7.x, semver@^7.3.5, semver@^7.3.7: semver@7.x, semver@^7.3.5, semver@^7.3.7:
version "7.5.1" version "7.5.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.2.tgz#5b851e66d1be07c1cdaf37dfc856f543325a2beb"
integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== integrity sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==
dependencies: dependencies:
lru-cache "^6.0.0" lru-cache "^6.0.0"