Compare commits
65 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25ef3926d1 | ||
|
|
4d33bd5f9c | ||
|
|
f25e47258b | ||
|
|
a3c4ccbde0 | ||
|
|
b114534101 | ||
|
|
303f064ba9 | ||
|
|
e981e53b7f | ||
|
|
d850ef91f7 | ||
|
|
8701b586f3 | ||
|
|
9b1ba9a603 | ||
|
|
18c8a4eceb | ||
|
|
892553a457 | ||
|
|
50a9cc9b7b | ||
|
|
c300d15dae | ||
|
|
c076064636 | ||
|
|
40526807ee | ||
|
|
a59bf8ffcf | ||
|
|
6821899764 | ||
|
|
bfc49f4cff | ||
|
|
7549e1e4b9 | ||
|
|
2fc653d87d | ||
|
|
273a7c1641 | ||
|
|
905fcf74f4 | ||
|
|
229fe310d2 | ||
|
|
85073ea010 | ||
|
|
e622bd9227 | ||
|
|
003b42ec7f | ||
|
|
0a5a862874 | ||
|
|
1864dc5311 | ||
|
|
1be6574035 | ||
|
|
51bc7ab145 | ||
|
|
b49b468c28 | ||
|
|
8055b31e95 | ||
|
|
c371c6f055 | ||
|
|
7448ec4f69 | ||
|
|
d1f3041043 | ||
|
|
d0064d8549 | ||
|
|
4270b9fd4b | ||
|
|
cd07d32e58 | ||
|
|
33ddc07d8b | ||
|
|
1c7fbaba14 | ||
|
|
af292f1e84 | ||
|
|
2ddcb04986 | ||
|
|
3ce5a2970f | ||
|
|
d898dd09e4 | ||
|
|
0e08afd95d | ||
|
|
955cdc8d81 | ||
|
|
e48cacbca5 | ||
|
|
5aee572571 | ||
|
|
c83cb31f5b | ||
|
|
fea790cb66 | ||
|
|
794c26fb9f | ||
|
|
0f6525cd7d | ||
|
|
28cf22057f | ||
|
|
faedee1163 | ||
|
|
4a7ca97de0 | ||
|
|
cef68eee2e | ||
|
|
40e81cc72b | ||
|
|
4d1f5becef | ||
|
|
c82b7e2992 | ||
|
|
02eb5a78aa | ||
|
|
2cee40ea93 | ||
|
|
5b02f7c186 | ||
|
|
2e7f228016 | ||
|
|
8a78ebb29f |
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -53,7 +53,7 @@ jobs:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
uses: actions/setup-node@v3.8.1
|
||||
uses: actions/setup-node@v4.0.0
|
||||
with:
|
||||
cache: 'yarn'
|
||||
node-version: '20.x'
|
||||
@@ -714,7 +714,7 @@ jobs:
|
||||
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
|
||||
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
|
||||
files: |
|
||||
test
|
||||
test/**
|
||||
recover_deleted_files: true
|
||||
fetch_depth: 60000
|
||||
|
||||
|
||||
185
HISTORY.md
185
HISTORY.md
@@ -1,5 +1,190 @@
|
||||
# Changelog
|
||||
|
||||
# [40.1.0](https://github.com/tj-actions/changed-files/compare/v40.0.2...v40.1.0) - (2023-11-03)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Add support for controlling the pattern order ([#1693](https://github.com/tj-actions/changed-files/issues/1693)) ([892553a](https://github.com/tj-actions/changed-files/commit/892553a4576166fd647dbd90ffa4b589f563572b)) - (Tonye Jack)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- **deps:** Update dependency yaml to v2.3.4 ([c300d15](https://github.com/tj-actions/changed-files/commit/c300d15daea754419fb9f133c53d821f0f6c17ea)) - (renovate[bot])
|
||||
|
||||
## <!-- 16 -->➕ Add
|
||||
|
||||
- Added missing changes and modified dist assets.
|
||||
([50a9cc9](https://github.com/tj-actions/changed-files/commit/50a9cc9b7b170bd6aaf4fb94db5da1c223606572)) - (GitHub Action)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1694](https://github.com/tj-actions/changed-files/issues/1694))
|
||||
|
||||
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([18c8a4e](https://github.com/tj-actions/changed-files/commit/18c8a4ecebe93d32ed8a88e1d0c098f5f68c221b)) - (tj-actions[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v40.0.2 ([#1689](https://github.com/tj-actions/changed-files/issues/1689))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([c076064](https://github.com/tj-actions/changed-files/commit/c07606463672e7c623bc2801b4002bd645aed1f2)) - (tj-actions[bot])
|
||||
|
||||
# [40.0.2](https://github.com/tj-actions/changed-files/compare/v40.0.1...v40.0.2) - (2023-10-31)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Order of file patterns ([#1688](https://github.com/tj-actions/changed-files/issues/1688)) ([4052680](https://github.com/tj-actions/changed-files/commit/40526807ee1e208a1a8c1bbe6bd2d1b044ef6368)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update dependency @types/node to v20.8.10 ([a59bf8f](https://github.com/tj-actions/changed-files/commit/a59bf8ffcfcfdd831463eff511b55a7123a04aca)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v40.0.1 ([#1686](https://github.com/tj-actions/changed-files/issues/1686))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([6821899](https://github.com/tj-actions/changed-files/commit/68218997649ac879f47639455e9669b94750b50f)) - (tj-actions[bot])
|
||||
|
||||
# [40.0.1](https://github.com/tj-actions/changed-files/compare/v40.0.0...v40.0.1) - (2023-10-30)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Bug with order in which the files and files ignore patterns are combined ([#1684](https://github.com/tj-actions/changed-files/issues/1684)) ([7549e1e](https://github.com/tj-actions/changed-files/commit/7549e1e4b967bf5f827b32249ec181ba542de0f9)) - (Tonye Jack)
|
||||
|
||||
## <!-- 16 -->➕ Add
|
||||
|
||||
- Added missing changes and modified dist assets.
|
||||
([905fcf7](https://github.com/tj-actions/changed-files/commit/905fcf74f4150b8b22f004a92bec5b19fb317419)) - (GitHub Action)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Update README.md ([85073ea](https://github.com/tj-actions/changed-files/commit/85073ea010ba5b57f37c14644d27dfb8a3d0de0a)) - (Tonye Jack)
|
||||
- Update README.md ([e622bd9](https://github.com/tj-actions/changed-files/commit/e622bd9227b3f21e2558a1ce4a648c4fb004fded)) - (Tonye Jack)
|
||||
- Update README.md ([003b42e](https://github.com/tj-actions/changed-files/commit/003b42ec7f4e3777746f3e170bfc1ec0cdd4c7a2)) - (Tonye Jack)
|
||||
- Update README.md ([0a5a862](https://github.com/tj-actions/changed-files/commit/0a5a86287477b9fcb4280d5141902816c2b86e46)) - (Tonye Jack)
|
||||
- Updated README.md ([#1678](https://github.com/tj-actions/changed-files/issues/1678))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([1864dc5](https://github.com/tj-actions/changed-files/commit/1864dc5311069c2319e40ddda20ebf24336dcba9)) - (tj-actions[bot])
|
||||
- Update action.yml ([1be6574](https://github.com/tj-actions/changed-files/commit/1be6574035556e1f982a4378491409b8daecec9a)) - (Tonye Jack)
|
||||
- Updated README.md ([#1677](https://github.com/tj-actions/changed-files/issues/1677))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([51bc7ab](https://github.com/tj-actions/changed-files/commit/51bc7ab1452b8422fc78f6bdda196b87881d0b1c)) - (tj-actions[bot])
|
||||
- Update README.md ([b49b468](https://github.com/tj-actions/changed-files/commit/b49b468c28d456fb7e7a75328e46efa820c4ff68)) - (Tonye Jack)
|
||||
- Update README.md ([8055b31](https://github.com/tj-actions/changed-files/commit/8055b31e957360a13988a323449bde618630f601)) - (Tonye Jack)
|
||||
- Updated README.md ([#1675](https://github.com/tj-actions/changed-files/issues/1675))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([d1f3041](https://github.com/tj-actions/changed-files/commit/d1f3041043a609731d86adbad78ca7a3b61dad33)) - (tj-actions[bot])
|
||||
- Update README.md ([d0064d8](https://github.com/tj-actions/changed-files/commit/d0064d854901a65f6b91787bd76dbadda53ebf83)) - (Tonye Jack)
|
||||
- Update README.md ([4270b9f](https://github.com/tj-actions/changed-files/commit/4270b9fd4b274ad12e0952979e8f32178abfaa06)) - (Tonye Jack)
|
||||
- Updated README.md ([#1673](https://github.com/tj-actions/changed-files/issues/1673))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([cd07d32](https://github.com/tj-actions/changed-files/commit/cd07d32e580fc8203249c9a435df3395a5edfd1b)) - (tj-actions[bot])
|
||||
- Update action.yml ([33ddc07](https://github.com/tj-actions/changed-files/commit/33ddc07d8b23cf31a8f614111160c5cc320f8f3d)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update dependency @types/jest to v29.5.7 ([bfc49f4](https://github.com/tj-actions/changed-files/commit/bfc49f4cff6934aa236c171f9bcbf1dd6b1ef438)) - (renovate[bot])
|
||||
- **deps:** Update dependency @typescript-eslint/eslint-plugin to v6.9.1 ([2fc653d](https://github.com/tj-actions/changed-files/commit/2fc653d87dc9507b87b24805ab59d23f7d3be7e5)) - (renovate[bot])
|
||||
- **deps:** Update dependency @typescript-eslint/parser to v6.9.1 ([273a7c1](https://github.com/tj-actions/changed-files/commit/273a7c1641fcdbffd00e804734185c2d99950485)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([229fe31](https://github.com/tj-actions/changed-files/commit/229fe310d2b3917af799b70b7b77fbed41df4961)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint-plugin-jest to v27.6.0 ([c371c6f](https://github.com/tj-actions/changed-files/commit/c371c6f055f523227ed33447a1a6fbd9d4d47aeb)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint-plugin-jest to v27.5.0 ([7448ec4](https://github.com/tj-actions/changed-files/commit/7448ec4f69ea819a3e647c5f057ba092aafb91f8)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v40 ([#1672](https://github.com/tj-actions/changed-files/issues/1672))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([1c7fbab](https://github.com/tj-actions/changed-files/commit/1c7fbaba144b87b134cd6c2c351477722fef4396)) - (tj-actions[bot])
|
||||
|
||||
# [40.0.0](https://github.com/tj-actions/changed-files/compare/v39.2.4...v40.0.0) - (2023-10-26)
|
||||
|
||||
## <!-- 13 -->📦 Bumps
|
||||
|
||||
- Bump @types/node from 20.8.7 to 20.8.8 ([#1666](https://github.com/tj-actions/changed-files/issues/1666))
|
||||
|
||||
Signed-off-by: dependabot[bot] <support@github.com>
|
||||
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> ([955cdc8](https://github.com/tj-actions/changed-files/commit/955cdc8d81246052a366a9a1c4e570774fe2b1c6)) - (dependabot[bot])
|
||||
|
||||
## <!-- 16 -->➕ Add
|
||||
|
||||
- Added missing changes and modified dist assets.
|
||||
([af292f1](https://github.com/tj-actions/changed-files/commit/af292f1e845a0377b596972698a8598734eb2796)) - (GitHub Action)
|
||||
- Added missing changes and modified dist assets.
|
||||
([e48cacb](https://github.com/tj-actions/changed-files/commit/e48cacbca52c259aaa62f428dd90bc4e374a8cda)) - (GitHub Action)
|
||||
|
||||
## <!-- 17 -->➖ Remove
|
||||
|
||||
- Appending globstar pattern for directories to prevent bugs with path matching ([#1670](https://github.com/tj-actions/changed-files/issues/1670)) ([3ce5a29](https://github.com/tj-actions/changed-files/commit/3ce5a2970f30e3278949b12f08ed68f90cc8e482)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Lock file maintenance ([2ddcb04](https://github.com/tj-actions/changed-files/commit/2ddcb04986856a468e97e777e87741f528cbad2b)) - (renovate[bot])
|
||||
- Update test.yml ([d898dd0](https://github.com/tj-actions/changed-files/commit/d898dd09e4531bdc144c5149b2d4de056819d8a4)) - (Tonye Jack)
|
||||
- **deps:** Update dependency @types/node to v20.8.9 ([0e08afd](https://github.com/tj-actions/changed-files/commit/0e08afd95d354d7dfa67484142cc153c96b816df)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([5aee572](https://github.com/tj-actions/changed-files/commit/5aee57257118b7f1a34194ed31f5faf4d56a1b04)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v39.2.4 ([#1664](https://github.com/tj-actions/changed-files/issues/1664))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([c83cb31](https://github.com/tj-actions/changed-files/commit/c83cb31f5b2aea1959056c29027ee2b838d88747)) - (tj-actions[bot])
|
||||
|
||||
# [39.2.4](https://github.com/tj-actions/changed-files/compare/v39.2.3...v39.2.4) - (2023-10-23)
|
||||
|
||||
## <!-- 16 -->➕ Add
|
||||
|
||||
- Added missing changes and modified dist assets.
|
||||
([28cf220](https://github.com/tj-actions/changed-files/commit/28cf22057fdc9b7c9328d0b5884e8c45b9316b22)) - (GitHub Action)
|
||||
- Added missing changes and modified dist assets.
|
||||
([40e81cc](https://github.com/tj-actions/changed-files/commit/40e81cc72b38d108b2ba0fb7c01296a426dc775a)) - (GitHub Action)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update typescript-eslint monorepo to v6.9.0 ([fea790c](https://github.com/tj-actions/changed-files/commit/fea790cb660e33aef4bdf07304e28fedd77dfa13)) - (renovate[bot])
|
||||
- **deps:** Update actions/setup-node action to v4 ([#1662](https://github.com/tj-actions/changed-files/issues/1662)) ([794c26f](https://github.com/tj-actions/changed-files/commit/794c26fb9f1f00d846ee83388f7b31ce2f6512da)) - (renovate[bot])
|
||||
- **deps:** Update actions/setup-node action to v3.8.2 ([0f6525c](https://github.com/tj-actions/changed-files/commit/0f6525cd7da1375f0db035f17af23c36e1fb7782)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([faedee1](https://github.com/tj-actions/changed-files/commit/faedee1163969ecb7501e1ecc85c15a3bc64108a)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint-plugin-jest to v27.4.3 ([4a7ca97](https://github.com/tj-actions/changed-files/commit/4a7ca97de0b5d33f2e5300bf1dc53444286c3275)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint to v8.52.0 ([cef68ee](https://github.com/tj-actions/changed-files/commit/cef68eee2ecab71f0d41f1da5ca539689caba074)) - (renovate[bot])
|
||||
- **deps:** Update dependency @vercel/ncc to v0.38.1 ([4d1f5be](https://github.com/tj-actions/changed-files/commit/4d1f5becef0a3eeedf05179e1d76c3ed49210249)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/uuid to v9.0.6 ([c82b7e2](https://github.com/tj-actions/changed-files/commit/c82b7e29920127a41f9a25b2dab101e63e14627c)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/node to v20.8.7 ([02eb5a7](https://github.com/tj-actions/changed-files/commit/02eb5a78aa173b07efe5bce41f9ecf0029cecde2)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/lodash to v4.14.200 ([2cee40e](https://github.com/tj-actions/changed-files/commit/2cee40ea9342da5bc5bb29c6af09d2ea35e216fe)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/micromatch to v4.0.4 ([5b02f7c](https://github.com/tj-actions/changed-files/commit/5b02f7c186bcb4d1f31582f2c3be28d5cc794ff2)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/jest to v29.5.6 ([2e7f228](https://github.com/tj-actions/changed-files/commit/2e7f228016e92a06ac5a941a38f2ddb297ba9c99)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v39.2.3 ([#1649](https://github.com/tj-actions/changed-files/issues/1649))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([8a78ebb](https://github.com/tj-actions/changed-files/commit/8a78ebb29fc795a2f216667dd5597a98e45e9085)) - (tj-actions[bot])
|
||||
|
||||
# [39.2.3](https://github.com/tj-actions/changed-files/compare/v39.2.2...v39.2.3) - (2023-10-17)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Bug returning files with matched patterns ([#1648](https://github.com/tj-actions/changed-files/issues/1648)) ([95690f9](https://github.com/tj-actions/changed-files/commit/95690f9ece77c1740f4a55b7f1de9023ed6b1f87)) - (Tonye Jack)
|
||||
- **deps:** Update dependency yaml to v2.3.3 ([4422568](https://github.com/tj-actions/changed-files/commit/44225688bb4d3bee3a2c2b89b075da711f6439ca)) - (renovate[bot])
|
||||
|
||||
## <!-- 16 -->➕ Add
|
||||
|
||||
- Added missing changes and modified dist assets.
|
||||
([2a10bef](https://github.com/tj-actions/changed-files/commit/2a10bef1b42044172f2e64d40beeb8fbad792438)) - (GitHub Action)
|
||||
- Added missing changes and modified dist assets.
|
||||
([a82ffc6](https://github.com/tj-actions/changed-files/commit/a82ffc67b399a2313a161e829a13cfe4136efd12)) - (GitHub Action)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update typescript-eslint monorepo to v6.8.0 ([9726642](https://github.com/tj-actions/changed-files/commit/97266423dbbb3fef38257a9049a722278bf9103c)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([af4b210](https://github.com/tj-actions/changed-files/commit/af4b21011169361c41b203dfabf25f57ff17bc59)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([5c45808](https://github.com/tj-actions/changed-files/commit/5c45808ea0d7a3f029ef6465447cd0f23cae87ed)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/node to v20.8.6 ([f144a9e](https://github.com/tj-actions/changed-files/commit/f144a9e6da20c676d410b6485f4dbb6b2390f3dd)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/node to v20.8.5 ([d08f64a](https://github.com/tj-actions/changed-files/commit/d08f64adf6f0e48966fc28a25a79e772b7d3804e)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v39.2.2 ([#1639](https://github.com/tj-actions/changed-files/issues/1639))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([2d0db8b](https://github.com/tj-actions/changed-files/commit/2d0db8be9ec241024f06a541c605733d4b325794)) - (tj-actions[bot])
|
||||
|
||||
# [39.2.2](https://github.com/tj-actions/changed-files/compare/v39.2.1...v39.2.2) - (2023-10-11)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
123
README.md
123
README.md
@@ -31,6 +31,7 @@ Effortlessly track all changed files and directories relative to a target branch
|
||||
* [Using local .git history 📁](#using-local-git-history-)
|
||||
* [Using Github's API :octocat:](#using-githubs-api-octocat)
|
||||
* [On `push` ⬆️](#on-push-️)
|
||||
* [Other supported events :electron:](#other-supported-events-electron)
|
||||
* [Useful Acronyms 🧮](#useful-acronyms-)
|
||||
* [Outputs 📤](#outputs-)
|
||||
* [Inputs ⚙️](#inputs-️)
|
||||
@@ -84,14 +85,15 @@ And many more...
|
||||
|
||||
> **Important**
|
||||
>
|
||||
> * For `push` events: When configuring [`actions/checkout`](https://github.com/actions/checkout#usage), make sure to set [`fetch-depth`](https://github.com/actions/checkout#usage) to either `0` or `2`, depending on your use case.
|
||||
> * For mono repositories where pulling all branch history might not be desired, you can still use the default [`fetch-depth`](https://github.com/actions/checkout#usage), which is set to `1` for `pull_request` events.
|
||||
> * Avoid using single or double quotes for multiline inputs, as the value is already a string separated by a newline character. See [Examples](#examples) for more information.
|
||||
> * If [`fetch-depth`](https://github.com/actions/checkout#usage) isn't set to `0`, ensure that [`persist-credentials`](https://github.com/actions/checkout#usage) is set to `true` when configuring [`actions/checkout`](https://github.com/actions/checkout#usage).
|
||||
> * **Push Events**: When configuring [`actions/checkout`](https://github.com/actions/checkout#usage), make sure to set [`fetch-depth`](https://github.com/actions/checkout#usage) to either `0` or `2`, depending on your use case.
|
||||
> * **Mono Repositories**: To avoid pulling the entire branch history, you can utilize the default [`actions/checkout`](https://github.com/actions/checkout#usage)'s [`fetch-depth`](https://github.com/actions/checkout#usage) of `1` for [`pull_request`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request) events.
|
||||
> * **Quoting Multiline Inputs**: Avoid using single or double quotes for [multiline](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml#L13-L16) inputs. The value is already a string separated by a newline character. Refer to the [Examples](#examples-) section for more information.
|
||||
> * **Credentials Persistence**: If [`fetch-depth`](https://github.com/actions/checkout#usage) is not set to 0, make sure to set [`persist-credentials`](https://github.com/actions/checkout#usage) to `true` when configuring [`actions/checkout`](https://github.com/actions/checkout#usage).
|
||||
> * **Matching Files and Folders**: To match all files and folders under a directory, this requires a globstar pattern e.g. `dir_name/**` which matches any number of subdirectories and files.
|
||||
|
||||
Visit the [discussions for more information](https://github.com/tj-actions/changed-files/discussions) or [create a new discussion](https://github.com/tj-actions/changed-files/discussions/new/choose) for usage-related questions.
|
||||
|
||||
### On `pull_request` 🔀
|
||||
### On [`pull_request`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request) 🔀
|
||||
|
||||
Detect changes to all files in a Pull request relative to the target branch or since the last pushed commit.
|
||||
|
||||
@@ -120,7 +122,7 @@ jobs:
|
||||
# Example 1
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
|
||||
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
|
||||
# with:
|
||||
@@ -133,13 +135,28 @@ jobs:
|
||||
done
|
||||
|
||||
# Example 2
|
||||
- name: Get all changed markdown files
|
||||
id: changed-markdown-files
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
files: |
|
||||
**.md
|
||||
# Avoid using single or double quotes for multiline patterns
|
||||
|
||||
- name: List all changed files markdown files
|
||||
run: |
|
||||
for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do
|
||||
echo "$file was changed"
|
||||
done
|
||||
|
||||
# Example 3
|
||||
- name: Get all test, doc and src files that have changed
|
||||
id: changed-files-yaml
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
files_yaml: |
|
||||
doc:
|
||||
- '**/*.md'
|
||||
- '**.md'
|
||||
- docs/**
|
||||
- README.md
|
||||
test:
|
||||
@@ -165,9 +182,9 @@ jobs:
|
||||
# Example 3
|
||||
- name: Get changed files in the docs folder
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs`
|
||||
files: docs/*.{js,html} # Alternatively using: `docs/**`
|
||||
files_ignore: docs/static.js
|
||||
|
||||
- name: Run step if any file(s) in the docs folder change
|
||||
@@ -205,7 +222,7 @@ jobs:
|
||||
steps:
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
|
||||
- name: List all changed files
|
||||
run: |
|
||||
@@ -214,7 +231,7 @@ jobs:
|
||||
done
|
||||
```
|
||||
|
||||
### On `push` ⬆️
|
||||
### On [`push`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push) ⬆️
|
||||
|
||||
Detect changes to files made since the last pushed commit.
|
||||
|
||||
@@ -226,26 +243,6 @@ on:
|
||||
branches:
|
||||
- main
|
||||
|
||||
# -------------------------------
|
||||
# Optionally run on other events
|
||||
# -------------------------------
|
||||
# schedule:
|
||||
# - cron: '0 0 * * *'
|
||||
#
|
||||
# release:
|
||||
# types: [...]
|
||||
#
|
||||
# workflow_dispatch:
|
||||
#
|
||||
# push:
|
||||
# tags:
|
||||
# - '**'
|
||||
#
|
||||
# merge_group:
|
||||
#
|
||||
# ...and many more
|
||||
|
||||
|
||||
jobs:
|
||||
# -------------------------------------------------------------
|
||||
# Using GitHub's API is not supported for push events
|
||||
@@ -266,7 +263,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
|
||||
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
|
||||
|
||||
@@ -278,6 +275,15 @@ jobs:
|
||||
...
|
||||
```
|
||||
|
||||
### Other supported events :electron:
|
||||
|
||||
* [schedule](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule)
|
||||
* [release](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release)
|
||||
* [workflow\_dispatch](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch)
|
||||
* [merge\_group](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#merge_group)
|
||||
* [issue\_comment](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment)
|
||||
* ...and many more
|
||||
|
||||
To access more examples, navigate to the [Examples](#examples-) section.
|
||||
|
||||
If you feel generous and want to show some extra appreciation:
|
||||
@@ -362,12 +368,12 @@ Support this project with a :star:
|
||||
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|
||||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|----------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| <a name="input_api_url"></a>[api\_url](#input_api_url) | string | false | `"${{ github.api_url }}"` | Github API URL. |
|
||||
| <a name="input_base_sha"></a>[base\_sha](#input_base_sha) | string | false | | Specify a different base commit <br>SHA used for comparing changes |
|
||||
| <a name="input_base_sha"></a>[base\_sha](#input_base_sha) | string | false | | Specify a different base commit <br>SHA or branch used for <br>comparing changes |
|
||||
| <a name="input_diff_relative"></a>[diff\_relative](#input_diff_relative) | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. |
|
||||
| <a name="input_dir_names"></a>[dir\_names](#input_dir_names) | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the current working directory <br>which defaults to `$GITHUB_WORKSPACE`. |
|
||||
| <a name="input_dir_names_deleted_files_include_only_deleted_dirs"></a>[dir\_names\_deleted\_files\_include\_only\_deleted\_dirs](#input_dir_names_deleted_files_include_only_deleted_dirs) | string | false | `"false"` | Include only directories that have <br>been deleted as opposed to <br>directory names of files that <br>have been deleted in the <br>`deleted_files` output when `dir_names` is <br>set to `true`. |
|
||||
| <a name="input_dir_names_exclude_current_dir"></a>[dir\_names\_exclude\_current\_dir](#input_dir_names_exclude_current_dir) | string | false | `"false"` | Exclude the current directory represented <br>by `.` from the output <br>when `dir_names` is set to <br>`true`. |
|
||||
| <a name="input_dir_names_include_files"></a>[dir\_names\_include\_files](#input_dir_names_include_files) | string | false | | Include files in the output <br>when `dir_names` is set to <br>`true`. **NOTE:** This returns only <br>the matching files and also <br>the directory names. |
|
||||
| <a name="input_dir_names_include_files"></a>[dir\_names\_include\_files](#input_dir_names_include_files) | string | false | | File and directory patterns to <br>include in the output when <br>`dir_names` is set to `true`. <br>**NOTE:** This returns only the <br>matching files and also the <br>directory names. |
|
||||
| <a name="input_dir_names_include_files_separator"></a>[dir\_names\_include\_files\_separator](#input_dir_names_include_files_separator) | string | false | `"\n"` | Separator used to split the <br>`dir_names_include_files` input |
|
||||
| <a name="input_dir_names_max_depth"></a>[dir\_names\_max\_depth](#input_dir_names_max_depth) | string | false | | Limit the directory output to <br>a maximum depth e.g `test/test1/test2` <br>with max depth of `2` <br>returns `test/test1`. |
|
||||
| <a name="input_escape_json"></a>[escape\_json](#input_escape_json) | string | false | `"true"` | Escape JSON output. |
|
||||
@@ -391,6 +397,7 @@ Support this project with a :star:
|
||||
| <a name="input_files_yaml_from_source_file_separator"></a>[files\_yaml\_from\_source\_file\_separator](#input_files_yaml_from_source_file_separator) | string | false | `"\n"` | Separator used to split the <br>`files_yaml_from_source_file` input |
|
||||
| <a name="input_include_all_old_new_renamed_files"></a>[include\_all\_old\_new\_renamed\_files](#input_include_all_old_new_renamed_files) | string | false | `"false"` | Include `all_old_new_renamed_files` output. Note this <br>can generate a large output <br>See: [#501](https://github.com/tj-actions/changed-files/issues/501). |
|
||||
| <a name="input_json"></a>[json](#input_json) | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. [Example](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-test.yml) |
|
||||
| <a name="input_negation_patterns_first"></a>[negation\_patterns\_first](#input_negation_patterns_first) | string | false | `"false"` | Apply the negation patterns first. <br>**NOTE:** This affects how changed <br>files are matched. |
|
||||
| <a name="input_old_new_files_separator"></a>[old\_new\_files\_separator](#input_old_new_files_separator) | string | false | `" "` | Split character for old and <br>new renamed filename pairs. |
|
||||
| <a name="input_old_new_separator"></a>[old\_new\_separator](#input_old_new_separator) | string | false | `","` | Split character for old and <br>new filename pairs. |
|
||||
| <a name="input_output_dir"></a>[output\_dir](#input_output_dir) | string | false | `".github/outputs"` | Directory to store output files. |
|
||||
@@ -404,7 +411,7 @@ Support this project with a :star:
|
||||
| <a name="input_recover_files_ignore_separator"></a>[recover\_files\_ignore\_separator](#input_recover_files_ignore_separator) | string | false | `"\n"` | Separator used to split the <br>`recover_files_ignore` input |
|
||||
| <a name="input_recover_files_separator"></a>[recover\_files\_separator](#input_recover_files_separator) | string | false | `"\n"` | Separator used to split the <br>`recover_files` input |
|
||||
| <a name="input_separator"></a>[separator](#input_separator) | string | false | `" "` | Split character for output strings |
|
||||
| <a name="input_sha"></a>[sha](#input_sha) | string | false | | Specify a different commit SHA <br>used for comparing changes |
|
||||
| <a name="input_sha"></a>[sha](#input_sha) | string | false | | Specify a different commit SHA <br>or branch used for comparing <br>changes |
|
||||
| <a name="input_since"></a>[since](#input_since) | string | false | | Get changed files for commits <br>whose timestamp is older than <br>the given time. |
|
||||
| <a name="input_since_last_remote_commit"></a>[since\_last\_remote\_commit](#input_since_last_remote_commit) | string | false | `"false"` | Use the last commit on <br>the remote branch as the <br>`base_sha`. Defaults to the last <br>non-merge commit on the target <br>branch for pull request events <br>and the previous remote commit <br>of the current branch for <br>push events. |
|
||||
| <a name="input_skip_initial_fetch"></a>[skip\_initial\_fetch](#input_skip_initial_fetch) | string | false | `"false"` | Skip the initial fetch to <br>improve performance for shallow repositories. <br>**NOTE**: This could lead to <br>errors with missing history and <br>the intended use is limited <br>to when you've fetched the <br>history necessary to perform the <br>diff. |
|
||||
@@ -435,7 +442,7 @@ The format of the version string is as follows:
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
...
|
||||
```
|
||||
|
||||
@@ -448,7 +455,7 @@ The format of the version string is as follows:
|
||||
...
|
||||
- name: Get all changed files and use a comma separator in the output
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
separator: ","
|
||||
...
|
||||
@@ -465,7 +472,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
|
||||
- name: List all added files
|
||||
run: |
|
||||
@@ -486,7 +493,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
|
||||
- name: Run a step if my-file.txt was modified
|
||||
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
|
||||
@@ -546,14 +553,14 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
*.sh
|
||||
*.png
|
||||
!*.md
|
||||
test_directory
|
||||
test_directory/**
|
||||
**/*.sql
|
||||
...
|
||||
```
|
||||
@@ -569,14 +576,14 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
*.sh
|
||||
*.png
|
||||
!*.md
|
||||
test_directory
|
||||
test_directory/**
|
||||
**/*.sql
|
||||
|
||||
- name: Run step if any of the listed files above change
|
||||
@@ -616,7 +623,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files using a source file or list of file(s) to populate to files input.
|
||||
id: changed-files-specific-source-file
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
files_from_source_file: test/changed-files-list.txt
|
||||
...
|
||||
@@ -633,7 +640,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a source file or list of file(s) to populate to files input and optionally specify more files.
|
||||
id: changed-files-specific-source-file-and-specify-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
@@ -654,7 +661,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a different SHA
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
sha: ${{ github.event.pull_request.head.sha }}
|
||||
...
|
||||
@@ -671,7 +678,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a different base SHA
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
base_sha: ${{ github.event.pull_request.base.sha }}
|
||||
...
|
||||
@@ -703,11 +710,11 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
|
||||
- name: Get changed files in the .github folder
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
|
||||
files: .github/**
|
||||
@@ -737,7 +744,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with defaults in dir1
|
||||
id: changed-files-for-dir1
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
path: dir1
|
||||
|
||||
@@ -760,7 +767,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with quotepath disabled
|
||||
id: changed-files-quotepath
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
quotepath: "false"
|
||||
|
||||
@@ -799,7 +806,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with the commit of the last successful test workflow run
|
||||
id: changed-files-base-sha-push
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
||||
...
|
||||
@@ -826,7 +833,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with the commit of the last successful test workflow run on the main branch
|
||||
id: changed-files-base-sha-pull-request
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
|
||||
...
|
||||
@@ -852,7 +859,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with dir_names
|
||||
id: changed-files-dir-names
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
dir_names: "true"
|
||||
...
|
||||
@@ -869,7 +876,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with JSON output
|
||||
id: changed-files-json
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
json: "true"
|
||||
...
|
||||
@@ -886,13 +893,13 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed-files since 2022-08-19
|
||||
id: changed-files-since
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
since: "2022-08-19"
|
||||
|
||||
- name: Get changed-files until 2022-08-20
|
||||
id: changed-files-until
|
||||
uses: tj-actions/changed-files@v39
|
||||
uses: tj-actions/changed-files@v40
|
||||
with:
|
||||
until: "2022-08-20"
|
||||
...
|
||||
|
||||
10
action.yml
10
action.yml
@@ -76,10 +76,10 @@ inputs:
|
||||
default: "\n"
|
||||
required: false
|
||||
sha:
|
||||
description: "Specify a different commit SHA used for comparing changes"
|
||||
description: "Specify a different commit SHA or branch used for comparing changes"
|
||||
required: false
|
||||
base_sha:
|
||||
description: "Specify a different base commit SHA used for comparing changes"
|
||||
description: "Specify a different base commit SHA or branch used for comparing changes"
|
||||
required: false
|
||||
since:
|
||||
description: "Get changed files for commits whose timestamp is older than the given time."
|
||||
@@ -113,7 +113,7 @@ inputs:
|
||||
required: false
|
||||
default: "false"
|
||||
dir_names_include_files:
|
||||
description: "Include files in the output when `dir_names` is set to `true`. **NOTE:** This returns only the matching files and also the directory names."
|
||||
description: "File and directory patterns to include in the output when `dir_names` is set to `true`. **NOTE:** This returns only the matching files and also the directory names."
|
||||
required: false
|
||||
default: ""
|
||||
dir_names_include_files_separator:
|
||||
@@ -200,6 +200,10 @@ inputs:
|
||||
description: "Fail when the submodule diff fails."
|
||||
required: false
|
||||
default: "false"
|
||||
negation_patterns_first:
|
||||
description: "Apply the negation patterns first. **NOTE:** This affects how changed files are matched."
|
||||
required: false
|
||||
default: "false"
|
||||
|
||||
outputs:
|
||||
added_files:
|
||||
|
||||
438
dist/index.js
generated
vendored
438
dist/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tj-actions/changed-files",
|
||||
"version": "39.2.2",
|
||||
"version": "40.1.0",
|
||||
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
|
||||
"main": "lib/main.js",
|
||||
"publishConfig": {
|
||||
|
||||
@@ -51,6 +51,7 @@ export type Inputs = {
|
||||
skipInitialFetch: boolean
|
||||
failOnInitialDiffError: boolean
|
||||
failOnSubmoduleDiffError: boolean
|
||||
negationPatternsFirst: boolean
|
||||
}
|
||||
|
||||
export const getInputs = (): Inputs => {
|
||||
@@ -218,6 +219,13 @@ export const getInputs = (): Inputs => {
|
||||
}
|
||||
)
|
||||
|
||||
const negationPatternsFirst = core.getBooleanInput(
|
||||
'negation_patterns_first',
|
||||
{
|
||||
required: false
|
||||
}
|
||||
)
|
||||
|
||||
const inputs: Inputs = {
|
||||
files,
|
||||
filesSeparator,
|
||||
@@ -268,7 +276,8 @@ export const getInputs = (): Inputs => {
|
||||
outputDir,
|
||||
outputRenamedFilesAsDeletedAndAdded,
|
||||
token,
|
||||
apiUrl
|
||||
apiUrl,
|
||||
negationPatternsFirst
|
||||
}
|
||||
|
||||
if (fetchDepth) {
|
||||
|
||||
92
src/utils.ts
92
src/utils.ts
@@ -938,93 +938,99 @@ export const getFilePatterns = async ({
|
||||
inputs: Inputs
|
||||
workingDirectory: string
|
||||
}): Promise<string[]> => {
|
||||
let filePatterns = inputs.files
|
||||
.split(inputs.filesSeparator)
|
||||
.filter(Boolean)
|
||||
.join('\n')
|
||||
let cleanedFilePatterns: string[] = []
|
||||
|
||||
if (inputs.files) {
|
||||
const filesPatterns = inputs.files
|
||||
.split(inputs.filesSeparator)
|
||||
.filter(Boolean)
|
||||
|
||||
cleanedFilePatterns.push(...filesPatterns)
|
||||
|
||||
core.debug(`files patterns: ${filesPatterns.join('\n')}`)
|
||||
}
|
||||
|
||||
if (inputs.filesFromSourceFile !== '') {
|
||||
const inputFilesFromSourceFile = inputs.filesFromSourceFile
|
||||
.split(inputs.filesFromSourceFileSeparator)
|
||||
.filter(p => p !== '')
|
||||
.filter(Boolean)
|
||||
.map(p => path.join(workingDirectory, p))
|
||||
|
||||
core.debug(`files from source file: ${inputFilesFromSourceFile}`)
|
||||
|
||||
const filesFromSourceFiles = (
|
||||
await getFilesFromSourceFile({filePaths: inputFilesFromSourceFile})
|
||||
).join('\n')
|
||||
const filesFromSourceFiles = await getFilesFromSourceFile({
|
||||
filePaths: inputFilesFromSourceFile
|
||||
})
|
||||
|
||||
core.debug(`files from source files patterns: ${filesFromSourceFiles}`)
|
||||
core.debug(
|
||||
`files from source files patterns: ${filesFromSourceFiles.join('\n')}`
|
||||
)
|
||||
|
||||
filePatterns = filePatterns.concat('\n', filesFromSourceFiles)
|
||||
cleanedFilePatterns.push(...filesFromSourceFiles)
|
||||
}
|
||||
|
||||
if (inputs.filesIgnore) {
|
||||
const filesIgnorePatterns = inputs.filesIgnore
|
||||
.split(inputs.filesIgnoreSeparator)
|
||||
.filter(p => p !== '')
|
||||
.filter(Boolean)
|
||||
.map(p => {
|
||||
if (!p.startsWith('!')) {
|
||||
p = `!${p}`
|
||||
}
|
||||
return p
|
||||
})
|
||||
.join('\n')
|
||||
|
||||
core.debug(`files ignore patterns: ${filesIgnorePatterns}`)
|
||||
core.debug(`files ignore patterns: ${filesIgnorePatterns.join('\n')}`)
|
||||
|
||||
filePatterns = filePatterns.concat('\n', filesIgnorePatterns)
|
||||
cleanedFilePatterns.push(...filesIgnorePatterns)
|
||||
}
|
||||
|
||||
if (inputs.filesIgnoreFromSourceFile) {
|
||||
const inputFilesIgnoreFromSourceFile = inputs.filesIgnoreFromSourceFile
|
||||
.split(inputs.filesIgnoreFromSourceFileSeparator)
|
||||
.filter(p => p !== '')
|
||||
.filter(Boolean)
|
||||
.map(p => path.join(workingDirectory, p))
|
||||
|
||||
core.debug(
|
||||
`files ignore from source file: ${inputFilesIgnoreFromSourceFile}`
|
||||
)
|
||||
|
||||
const filesIgnoreFromSourceFiles = (
|
||||
await getFilesFromSourceFile({
|
||||
filePaths: inputFilesIgnoreFromSourceFile,
|
||||
excludedFiles: true
|
||||
})
|
||||
).join('\n')
|
||||
const filesIgnoreFromSourceFiles = await getFilesFromSourceFile({
|
||||
filePaths: inputFilesIgnoreFromSourceFile,
|
||||
excludedFiles: true
|
||||
})
|
||||
|
||||
core.debug(
|
||||
`files ignore from source files patterns: ${filesIgnoreFromSourceFiles}`
|
||||
`files ignore from source files patterns: ${filesIgnoreFromSourceFiles.join(
|
||||
'\n'
|
||||
)}`
|
||||
)
|
||||
|
||||
filePatterns = filePatterns.concat('\n', filesIgnoreFromSourceFiles)
|
||||
cleanedFilePatterns.push(...filesIgnoreFromSourceFiles)
|
||||
}
|
||||
|
||||
if (inputs.negationPatternsFirst) {
|
||||
cleanedFilePatterns.sort((a, b) => {
|
||||
return a.startsWith('!') ? -1 : b.startsWith('!') ? 1 : 0
|
||||
})
|
||||
}
|
||||
|
||||
// Reorder file patterns '**' should come first
|
||||
if (cleanedFilePatterns.includes('**')) {
|
||||
cleanedFilePatterns.sort((a, b) => {
|
||||
return a === '**' ? -1 : b === '**' ? 1 : 0
|
||||
})
|
||||
}
|
||||
|
||||
if (isWindows()) {
|
||||
filePatterns = filePatterns.replace(/\r\n/g, '\n')
|
||||
filePatterns = filePatterns.replace(/\r/g, '\n')
|
||||
cleanedFilePatterns = cleanedFilePatterns.map(pattern =>
|
||||
pattern.replace(/\r\n/g, '\n').replace(/\r/g, '\n')
|
||||
)
|
||||
}
|
||||
|
||||
core.debug(`Input file patterns: ${filePatterns}`)
|
||||
core.debug(`Input file patterns: \n${cleanedFilePatterns.join('\n')}`)
|
||||
|
||||
return filePatterns
|
||||
.trim()
|
||||
.split('\n')
|
||||
.filter(Boolean)
|
||||
.map(pattern => {
|
||||
if (pattern.endsWith('/')) {
|
||||
return `${pattern}**`
|
||||
} else {
|
||||
const pathParts = pattern.split('/')
|
||||
const lastPart = pathParts[pathParts.length - 1]
|
||||
if (!lastPart.includes('.') && !lastPart.endsWith('*')) {
|
||||
return `${pattern}/**`
|
||||
} else {
|
||||
return pattern
|
||||
}
|
||||
}
|
||||
})
|
||||
return cleanedFilePatterns
|
||||
}
|
||||
|
||||
// Example YAML input:
|
||||
|
||||
Reference in New Issue
Block a user