Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
95690f9ece | ||
|
|
97266423db | ||
|
|
af4b210111 | ||
|
|
2a10bef1b4 | ||
|
|
5c45808ea0 | ||
|
|
a82ffc67b3 | ||
|
|
44225688bb | ||
|
|
f144a9e6da | ||
|
|
d08f64adf6 | ||
|
|
2d0db8be9e |
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
|
||||
|
||||
|
||||
178
HISTORY.md
178
HISTORY.md
@@ -1,5 +1,183 @@
|
||||
# Changelog
|
||||
|
||||
# [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
|
||||
|
||||
- **deps:** Update dependency @actions/github to v6 ([#1636](https://github.com/tj-actions/changed-files/issues/1636)) ([1d9d8f4](https://github.com/tj-actions/changed-files/commit/1d9d8f4a769e0e15ef6d9657ceb4c64b4f79444a)) - (renovate[bot])
|
||||
|
||||
## <!-- 16 -->➕ Add
|
||||
|
||||
- Added missing changes and modified dist assets.
|
||||
([408093d](https://github.com/tj-actions/changed-files/commit/408093d9ff9c134c33b974e0722ce06b9d6e8263)) - (GitHub Action)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Update README.md ([49e754c](https://github.com/tj-actions/changed-files/commit/49e754c81d45331f68e6691ca91590e12f0bf105)) - (Tonye Jack)
|
||||
- Updated README.md ([#1632](https://github.com/tj-actions/changed-files/issues/1632))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([5742169](https://github.com/tj-actions/changed-files/commit/57421690e0ad0aaa68f8a7de7cdcec0ac85f4471)) - (tj-actions[bot])
|
||||
- Update README.md ([1c14cc7](https://github.com/tj-actions/changed-files/commit/1c14cc7ff31c36290d78b6beedcbfdd8eb6c1ad6)) - (Tonye Jack)
|
||||
- Update README.md ([6cd5b66](https://github.com/tj-actions/changed-files/commit/6cd5b661017dec80808b3d6fe58017f11898979c)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Lock file maintenance ([a8fcc78](https://github.com/tj-actions/changed-files/commit/a8fcc78511f2e612fe60b52f342af99c9bfc53e8)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint-plugin-prettier to v5.0.1 ([3b9406e](https://github.com/tj-actions/changed-files/commit/3b9406ef8235796a97765ef91c44294ef70175a1)) - (renovate[bot])
|
||||
- **deps:** Update nrwl/nx-set-shas action to v4 ([#1635](https://github.com/tj-actions/changed-files/issues/1635)) ([6777efe](https://github.com/tj-actions/changed-files/commit/6777efe3caaf110650443295dcfe44b6001c2803)) - (renovate[bot])
|
||||
- **deps:** Update typescript-eslint monorepo to v6.7.5 ([2b4a057](https://github.com/tj-actions/changed-files/commit/2b4a057e157f0c14d0bc6ee271924108cbe99aaf)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/node to v20.8.4 ([1e88b75](https://github.com/tj-actions/changed-files/commit/1e88b750d46079ab0916821bfba40c1890fc9064)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/node to v20.8.3 ([54864d4](https://github.com/tj-actions/changed-files/commit/54864d4c3b647ac620a1bcbc02d2e82dea105902)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint to v8.51.0 ([8f6e85f](https://github.com/tj-actions/changed-files/commit/8f6e85fcdfa6c88613a3c33e6d6b1f9ef44c68e9)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v39.2.1 ([#1628](https://github.com/tj-actions/changed-files/issues/1628))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([3729bf2](https://github.com/tj-actions/changed-files/commit/3729bf289f532adbcb2e7b4d887b770c9fa2add8)) - (tj-actions[bot])
|
||||
|
||||
# [39.2.1](https://github.com/tj-actions/changed-files/compare/v39.2.0...v39.2.1) - (2023-10-03)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
122
README.md
122
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. |
|
||||
@@ -404,7 +410,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 +441,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 +454,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 +471,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 +492,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 +552,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 +575,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 +622,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 +639,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 +660,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 +677,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 +709,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 +743,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 +766,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 +805,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 +832,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 +858,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 +875,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 +892,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"
|
||||
...
|
||||
|
||||
@@ -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:
|
||||
|
||||
374
dist/index.js
generated
vendored
374
dist/index.js
generated
vendored
@@ -2542,20 +2542,7 @@ const getDirNamesIncludeFilesPattern = ({ inputs }) => {
|
||||
};
|
||||
exports.getDirNamesIncludeFilesPattern = getDirNamesIncludeFilesPattern;
|
||||
const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
let filePatterns = inputs.files
|
||||
.split(inputs.filesSeparator)
|
||||
.filter(Boolean)
|
||||
.join('\n');
|
||||
if (inputs.filesFromSourceFile !== '') {
|
||||
const inputFilesFromSourceFile = inputs.filesFromSourceFile
|
||||
.split(inputs.filesFromSourceFileSeparator)
|
||||
.filter(p => p !== '')
|
||||
.map(p => path.join(workingDirectory, p));
|
||||
core.debug(`files from source file: ${inputFilesFromSourceFile}`);
|
||||
const filesFromSourceFiles = (yield getFilesFromSourceFile({ filePaths: inputFilesFromSourceFile })).join('\n');
|
||||
core.debug(`files from source files patterns: ${filesFromSourceFiles}`);
|
||||
filePatterns = filePatterns.concat('\n', filesFromSourceFiles);
|
||||
}
|
||||
let filePatterns = '';
|
||||
if (inputs.filesIgnore) {
|
||||
const filesIgnorePatterns = inputs.filesIgnore
|
||||
.split(inputs.filesIgnoreSeparator)
|
||||
@@ -2583,30 +2570,32 @@ const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void
|
||||
core.debug(`files ignore from source files patterns: ${filesIgnoreFromSourceFiles}`);
|
||||
filePatterns = filePatterns.concat('\n', filesIgnoreFromSourceFiles);
|
||||
}
|
||||
if (inputs.files) {
|
||||
filePatterns = filePatterns.concat('\n', inputs.files.split(inputs.filesSeparator).filter(Boolean).join('\n'));
|
||||
}
|
||||
if (inputs.filesFromSourceFile !== '') {
|
||||
const inputFilesFromSourceFile = inputs.filesFromSourceFile
|
||||
.split(inputs.filesFromSourceFileSeparator)
|
||||
.filter(p => p !== '')
|
||||
.map(p => path.join(workingDirectory, p));
|
||||
core.debug(`files from source file: ${inputFilesFromSourceFile}`);
|
||||
const filesFromSourceFiles = (yield getFilesFromSourceFile({ filePaths: inputFilesFromSourceFile })).join('\n');
|
||||
core.debug(`files from source files patterns: ${filesFromSourceFiles}`);
|
||||
filePatterns = filePatterns.concat('\n', filesFromSourceFiles);
|
||||
}
|
||||
if ((0, exports.isWindows)()) {
|
||||
filePatterns = filePatterns.replace(/\r\n/g, '\n');
|
||||
filePatterns = filePatterns.replace(/\r/g, '\n');
|
||||
}
|
||||
core.debug(`Input file patterns: ${filePatterns}`);
|
||||
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('.')) {
|
||||
return `${pattern}/**`;
|
||||
}
|
||||
else {
|
||||
return pattern;
|
||||
}
|
||||
}
|
||||
});
|
||||
const filePatternsArray = filePatterns.trim().split('\n').filter(Boolean);
|
||||
// Reorder file patterns '**' should come before '!**/*.txt' and then the rest 'dir/**/*.txt'
|
||||
if (filePatternsArray.includes('**')) {
|
||||
filePatternsArray.sort((a, b) => {
|
||||
return a === '**' ? -1 : b === '**' ? 1 : 0;
|
||||
});
|
||||
}
|
||||
core.debug(`Input file patterns: \n${filePatternsArray.join('\n')}`);
|
||||
return filePatternsArray;
|
||||
});
|
||||
exports.getFilePatterns = getFilePatterns;
|
||||
const getYamlFilePatternsFromContents = ({ content = '', filePath = '', excludedFiles = false }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
@@ -7848,7 +7837,7 @@ module.exports = __toCommonJS(dist_src_exports);
|
||||
var import_universal_user_agent = __nccwpck_require__(5030);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "9.0.1";
|
||||
var VERSION = "9.0.2";
|
||||
|
||||
// pkg/dist-src/defaults.js
|
||||
var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
|
||||
@@ -8056,7 +8045,7 @@ function parseUrl(template) {
|
||||
}
|
||||
function expand(template, context) {
|
||||
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
||||
return template.replace(
|
||||
template = template.replace(
|
||||
/\{([^\{\}]+)\}|([^\{\}]+)/g,
|
||||
function(_, expression, literal) {
|
||||
if (expression) {
|
||||
@@ -8086,6 +8075,11 @@ function expand(template, context) {
|
||||
}
|
||||
}
|
||||
);
|
||||
if (template === "/") {
|
||||
return template;
|
||||
} else {
|
||||
return template.replace(/\/$/, "");
|
||||
}
|
||||
}
|
||||
|
||||
// pkg/dist-src/parse.js
|
||||
@@ -8370,7 +8364,7 @@ __export(dist_src_exports, {
|
||||
module.exports = __toCommonJS(dist_src_exports);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "9.0.0";
|
||||
var VERSION = "9.1.2";
|
||||
|
||||
// pkg/dist-src/normalize-paginated-list-response.js
|
||||
function normalizePaginatedListResponse(response) {
|
||||
@@ -8539,9 +8533,11 @@ var paginatingEndpoints = [
|
||||
"GET /orgs/{org}/personal-access-tokens",
|
||||
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
|
||||
"GET /orgs/{org}/projects",
|
||||
"GET /orgs/{org}/properties/values",
|
||||
"GET /orgs/{org}/public_members",
|
||||
"GET /orgs/{org}/repos",
|
||||
"GET /orgs/{org}/rulesets",
|
||||
"GET /orgs/{org}/rulesets/rule-suites",
|
||||
"GET /orgs/{org}/secret-scanning/alerts",
|
||||
"GET /orgs/{org}/security-advisories",
|
||||
"GET /orgs/{org}/teams",
|
||||
@@ -8633,6 +8629,7 @@ var paginatingEndpoints = [
|
||||
"GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
|
||||
"GET /repos/{owner}/{repo}/rules/branches/{branch}",
|
||||
"GET /repos/{owner}/{repo}/rulesets",
|
||||
"GET /repos/{owner}/{repo}/rulesets/rule-suites",
|
||||
"GET /repos/{owner}/{repo}/secret-scanning/alerts",
|
||||
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
|
||||
"GET /repos/{owner}/{repo}/security-advisories",
|
||||
@@ -8764,7 +8761,7 @@ __export(dist_src_exports, {
|
||||
module.exports = __toCommonJS(dist_src_exports);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "10.0.0";
|
||||
var VERSION = "10.1.2";
|
||||
|
||||
// pkg/dist-src/generated/endpoints.js
|
||||
var Endpoints = {
|
||||
@@ -8869,6 +8866,9 @@ var Endpoints = {
|
||||
enableWorkflow: [
|
||||
"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
|
||||
],
|
||||
forceCancelWorkflowRun: [
|
||||
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
|
||||
],
|
||||
generateRunnerJitconfigForOrg: [
|
||||
"POST /orgs/{org}/actions/runners/generate-jitconfig"
|
||||
],
|
||||
@@ -9278,6 +9278,9 @@ var Endpoints = {
|
||||
addSelectedRepoToOrgSecret: [
|
||||
"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
|
||||
],
|
||||
checkPermissionsForDevcontainer: [
|
||||
"GET /repos/{owner}/{repo}/codespaces/permissions_check"
|
||||
],
|
||||
codespaceMachinesForAuthenticatedUser: [
|
||||
"GET /user/codespaces/{codespace_name}/machines"
|
||||
],
|
||||
@@ -9395,7 +9398,7 @@ var Endpoints = {
|
||||
"DELETE /orgs/{org}/copilot/billing/selected_users"
|
||||
],
|
||||
getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
|
||||
getCopilotSeatAssignmentDetailsForUser: [
|
||||
getCopilotSeatDetailsForUser: [
|
||||
"GET /orgs/{org}/members/{username}/copilot"
|
||||
],
|
||||
listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
|
||||
@@ -9608,7 +9611,13 @@ var Endpoints = {
|
||||
root: ["GET /"]
|
||||
},
|
||||
migrations: {
|
||||
cancelImport: ["DELETE /repos/{owner}/{repo}/import"],
|
||||
cancelImport: [
|
||||
"DELETE /repos/{owner}/{repo}/import",
|
||||
{},
|
||||
{
|
||||
deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
|
||||
}
|
||||
],
|
||||
deleteArchiveForAuthenticatedUser: [
|
||||
"DELETE /user/migrations/{migration_id}/archive"
|
||||
],
|
||||
@@ -9621,9 +9630,27 @@ var Endpoints = {
|
||||
getArchiveForAuthenticatedUser: [
|
||||
"GET /user/migrations/{migration_id}/archive"
|
||||
],
|
||||
getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"],
|
||||
getImportStatus: ["GET /repos/{owner}/{repo}/import"],
|
||||
getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"],
|
||||
getCommitAuthors: [
|
||||
"GET /repos/{owner}/{repo}/import/authors",
|
||||
{},
|
||||
{
|
||||
deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
|
||||
}
|
||||
],
|
||||
getImportStatus: [
|
||||
"GET /repos/{owner}/{repo}/import",
|
||||
{},
|
||||
{
|
||||
deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
|
||||
}
|
||||
],
|
||||
getLargeFiles: [
|
||||
"GET /repos/{owner}/{repo}/import/large_files",
|
||||
{},
|
||||
{
|
||||
deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
|
||||
}
|
||||
],
|
||||
getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
|
||||
getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
|
||||
listForAuthenticatedUser: ["GET /user/migrations"],
|
||||
@@ -9637,18 +9664,42 @@ var Endpoints = {
|
||||
{},
|
||||
{ renamed: ["migrations", "listReposForAuthenticatedUser"] }
|
||||
],
|
||||
mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"],
|
||||
setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"],
|
||||
mapCommitAuthor: [
|
||||
"PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
|
||||
{},
|
||||
{
|
||||
deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
|
||||
}
|
||||
],
|
||||
setLfsPreference: [
|
||||
"PATCH /repos/{owner}/{repo}/import/lfs",
|
||||
{},
|
||||
{
|
||||
deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
|
||||
}
|
||||
],
|
||||
startForAuthenticatedUser: ["POST /user/migrations"],
|
||||
startForOrg: ["POST /orgs/{org}/migrations"],
|
||||
startImport: ["PUT /repos/{owner}/{repo}/import"],
|
||||
startImport: [
|
||||
"PUT /repos/{owner}/{repo}/import",
|
||||
{},
|
||||
{
|
||||
deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
|
||||
}
|
||||
],
|
||||
unlockRepoForAuthenticatedUser: [
|
||||
"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
|
||||
],
|
||||
unlockRepoForOrg: [
|
||||
"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
|
||||
],
|
||||
updateImport: ["PATCH /repos/{owner}/{repo}/import"]
|
||||
updateImport: [
|
||||
"PATCH /repos/{owner}/{repo}/import",
|
||||
{},
|
||||
{
|
||||
deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
|
||||
}
|
||||
]
|
||||
},
|
||||
orgs: {
|
||||
addSecurityManagerTeam: [
|
||||
@@ -9663,6 +9714,13 @@ var Endpoints = {
|
||||
"PUT /orgs/{org}/outside_collaborators/{username}"
|
||||
],
|
||||
createInvitation: ["POST /orgs/{org}/invitations"],
|
||||
createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
|
||||
createOrUpdateCustomPropertiesValuesForRepos: [
|
||||
"PATCH /orgs/{org}/properties/values"
|
||||
],
|
||||
createOrUpdateCustomProperty: [
|
||||
"PUT /orgs/{org}/properties/schema/{custom_property_name}"
|
||||
],
|
||||
createWebhook: ["POST /orgs/{org}/hooks"],
|
||||
delete: ["DELETE /orgs/{org}"],
|
||||
deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
|
||||
@@ -9670,6 +9728,10 @@ var Endpoints = {
|
||||
"POST /orgs/{org}/{security_product}/{enablement}"
|
||||
],
|
||||
get: ["GET /orgs/{org}"],
|
||||
getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
|
||||
getCustomProperty: [
|
||||
"GET /orgs/{org}/properties/schema/{custom_property_name}"
|
||||
],
|
||||
getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
|
||||
getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
|
||||
getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
|
||||
@@ -9680,6 +9742,7 @@ var Endpoints = {
|
||||
list: ["GET /organizations"],
|
||||
listAppInstallations: ["GET /orgs/{org}/installations"],
|
||||
listBlockedUsers: ["GET /orgs/{org}/blocks"],
|
||||
listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
|
||||
listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
|
||||
listForAuthenticatedUser: ["GET /user/orgs"],
|
||||
listForUser: ["GET /users/{username}/orgs"],
|
||||
@@ -9704,6 +9767,9 @@ var Endpoints = {
|
||||
redeliverWebhookDelivery: [
|
||||
"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
|
||||
],
|
||||
removeCustomProperty: [
|
||||
"DELETE /orgs/{org}/properties/schema/{custom_property_name}"
|
||||
],
|
||||
removeMember: ["DELETE /orgs/{org}/members/{username}"],
|
||||
removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
|
||||
removeOutsideCollaborator: [
|
||||
@@ -10184,6 +10250,7 @@ var Endpoints = {
|
||||
getCustomDeploymentProtectionRule: [
|
||||
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
|
||||
],
|
||||
getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
|
||||
getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
|
||||
getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
|
||||
getDeploymentBranchPolicy: [
|
||||
@@ -10197,6 +10264,8 @@ var Endpoints = {
|
||||
],
|
||||
getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
|
||||
getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
|
||||
getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
|
||||
getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
|
||||
getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
|
||||
getOrgRulesets: ["GET /orgs/{org}/rulesets"],
|
||||
getPages: ["GET /repos/{owner}/{repo}/pages"],
|
||||
@@ -10212,6 +10281,10 @@ var Endpoints = {
|
||||
getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
|
||||
getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
|
||||
getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
|
||||
getRepoRuleSuite: [
|
||||
"GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
|
||||
],
|
||||
getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
|
||||
getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
|
||||
getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
|
||||
getStatusChecksProtection: [
|
||||
@@ -10647,11 +10720,41 @@ for (const [scope, endpoints] of Object.entries(endpoints_default)) {
|
||||
}
|
||||
}
|
||||
var handler = {
|
||||
has({ scope }, methodName) {
|
||||
return endpointMethodsMap.get(scope).has(methodName);
|
||||
},
|
||||
getOwnPropertyDescriptor(target, methodName) {
|
||||
return {
|
||||
value: this.get(target, methodName),
|
||||
// ensures method is in the cache
|
||||
configurable: true,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
};
|
||||
},
|
||||
defineProperty(target, methodName, descriptor) {
|
||||
Object.defineProperty(target.cache, methodName, descriptor);
|
||||
return true;
|
||||
},
|
||||
deleteProperty(target, methodName) {
|
||||
delete target.cache[methodName];
|
||||
return true;
|
||||
},
|
||||
ownKeys({ scope }) {
|
||||
return [...endpointMethodsMap.get(scope).keys()];
|
||||
},
|
||||
set(target, methodName, value) {
|
||||
return target.cache[methodName] = value;
|
||||
},
|
||||
get({ octokit, scope, cache }, methodName) {
|
||||
if (cache[methodName]) {
|
||||
return cache[methodName];
|
||||
}
|
||||
const { decorations, endpointDefaults } = endpointMethodsMap.get(scope).get(methodName);
|
||||
const method = endpointMethodsMap.get(scope).get(methodName);
|
||||
if (!method) {
|
||||
return void 0;
|
||||
}
|
||||
const { endpointDefaults, decorations } = method;
|
||||
if (decorations) {
|
||||
cache[methodName] = decorate(
|
||||
octokit,
|
||||
@@ -34427,6 +34530,10 @@ class StreamHandler extends AsyncResource {
|
||||
{ callback, body: res, contentType, statusCode, statusMessage, headers }
|
||||
)
|
||||
} else {
|
||||
if (factory === null) {
|
||||
return
|
||||
}
|
||||
|
||||
res = this.runInAsyncScope(factory, null, {
|
||||
statusCode,
|
||||
headers,
|
||||
@@ -34475,7 +34582,7 @@ class StreamHandler extends AsyncResource {
|
||||
onData (chunk) {
|
||||
const { res } = this
|
||||
|
||||
return res.write(chunk)
|
||||
return res ? res.write(chunk) : true
|
||||
}
|
||||
|
||||
onComplete (trailers) {
|
||||
@@ -34483,6 +34590,10 @@ class StreamHandler extends AsyncResource {
|
||||
|
||||
removeSignal(this)
|
||||
|
||||
if (!res) {
|
||||
return
|
||||
}
|
||||
|
||||
this.trailers = util.parseHeaders(trailers)
|
||||
|
||||
res.end()
|
||||
@@ -34939,7 +35050,7 @@ function consumeEnd (consume) {
|
||||
pos += buf.byteLength
|
||||
}
|
||||
|
||||
resolve(dst)
|
||||
resolve(dst.buffer)
|
||||
} else if (type === 'blob') {
|
||||
if (!Blob) {
|
||||
Blob = (__nccwpck_require__(4300).Blob)
|
||||
@@ -37375,7 +37486,9 @@ function onParserTimeout (parser) {
|
||||
|
||||
function onSocketReadable () {
|
||||
const { [kParser]: parser } = this
|
||||
parser.readMore()
|
||||
if (parser) {
|
||||
parser.readMore()
|
||||
}
|
||||
}
|
||||
|
||||
function onSocketError (err) {
|
||||
@@ -40138,6 +40251,14 @@ class Request {
|
||||
if (channels.bodySent.hasSubscribers) {
|
||||
channels.bodySent.publish({ request: this })
|
||||
}
|
||||
|
||||
if (this[kHandler].onRequestSent) {
|
||||
try {
|
||||
this[kHandler].onRequestSent()
|
||||
} catch (err) {
|
||||
this.onError(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onConnect (abort) {
|
||||
@@ -41191,6 +41312,8 @@ let ReadableStream = globalThis.ReadableStream
|
||||
|
||||
/** @type {globalThis['File']} */
|
||||
const File = NativeFile ?? UndiciFile
|
||||
const textEncoder = new TextEncoder()
|
||||
const textDecoder = new TextDecoder()
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-bodyinit-extract
|
||||
function extractBody (object, keepalive = false) {
|
||||
@@ -41214,7 +41337,7 @@ function extractBody (object, keepalive = false) {
|
||||
stream = new ReadableStream({
|
||||
async pull (controller) {
|
||||
controller.enqueue(
|
||||
typeof source === 'string' ? new TextEncoder().encode(source) : source
|
||||
typeof source === 'string' ? textEncoder.encode(source) : source
|
||||
)
|
||||
queueMicrotask(() => readableStreamClose(controller))
|
||||
},
|
||||
@@ -41284,7 +41407,6 @@ function extractBody (object, keepalive = false) {
|
||||
// - That the content-length is calculated in advance.
|
||||
// - And that all parts are pre-encoded and ready to be sent.
|
||||
|
||||
const enc = new TextEncoder()
|
||||
const blobParts = []
|
||||
const rn = new Uint8Array([13, 10]) // '\r\n'
|
||||
length = 0
|
||||
@@ -41292,13 +41414,13 @@ function extractBody (object, keepalive = false) {
|
||||
|
||||
for (const [name, value] of object) {
|
||||
if (typeof value === 'string') {
|
||||
const chunk = enc.encode(prefix +
|
||||
const chunk = textEncoder.encode(prefix +
|
||||
`; name="${escape(normalizeLinefeeds(name))}"` +
|
||||
`\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
|
||||
blobParts.push(chunk)
|
||||
length += chunk.byteLength
|
||||
} else {
|
||||
const chunk = enc.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
|
||||
const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
|
||||
(value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
|
||||
`Content-Type: ${
|
||||
value.type || 'application/octet-stream'
|
||||
@@ -41312,7 +41434,7 @@ function extractBody (object, keepalive = false) {
|
||||
}
|
||||
}
|
||||
|
||||
const chunk = enc.encode(`--${boundary}--`)
|
||||
const chunk = textEncoder.encode(`--${boundary}--`)
|
||||
blobParts.push(chunk)
|
||||
length += chunk.byteLength
|
||||
if (hasUnknownSizeValue) {
|
||||
@@ -41608,14 +41730,16 @@ function bodyMixinMethods (instance) {
|
||||
let text = ''
|
||||
// application/x-www-form-urlencoded parser will keep the BOM.
|
||||
// https://url.spec.whatwg.org/#concept-urlencoded-parser
|
||||
const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
|
||||
// Note that streaming decoder is stateful and cannot be reused
|
||||
const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
|
||||
|
||||
for await (const chunk of consumeBody(this[kState].body)) {
|
||||
if (!isUint8Array(chunk)) {
|
||||
throw new TypeError('Expected Uint8Array chunk')
|
||||
}
|
||||
text += textDecoder.decode(chunk, { stream: true })
|
||||
text += streamingDecoder.decode(chunk, { stream: true })
|
||||
}
|
||||
text += textDecoder.decode()
|
||||
text += streamingDecoder.decode()
|
||||
entries = new URLSearchParams(text)
|
||||
} catch (err) {
|
||||
// istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
|
||||
@@ -41730,7 +41854,7 @@ function utf8DecodeBytes (buffer) {
|
||||
|
||||
// 3. Process a queue with an instance of UTF-8’s
|
||||
// decoder, ioQueue, output, and "replacement".
|
||||
const output = new TextDecoder().decode(buffer)
|
||||
const output = textDecoder.decode(buffer)
|
||||
|
||||
// 4. Return output.
|
||||
return output
|
||||
@@ -41778,10 +41902,12 @@ module.exports = {
|
||||
const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
|
||||
|
||||
const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
|
||||
const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
|
||||
|
||||
const nullBodyStatus = [101, 204, 205, 304]
|
||||
|
||||
const redirectStatus = [301, 302, 303, 307, 308]
|
||||
const redirectStatusSet = new Set(redirectStatus)
|
||||
|
||||
// https://fetch.spec.whatwg.org/#block-bad-port
|
||||
const badPorts = [
|
||||
@@ -41793,6 +41919,8 @@ const badPorts = [
|
||||
'10080'
|
||||
]
|
||||
|
||||
const badPortsSet = new Set(badPorts)
|
||||
|
||||
// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
|
||||
const referrerPolicy = [
|
||||
'',
|
||||
@@ -41805,10 +41933,12 @@ const referrerPolicy = [
|
||||
'strict-origin-when-cross-origin',
|
||||
'unsafe-url'
|
||||
]
|
||||
const referrerPolicySet = new Set(referrerPolicy)
|
||||
|
||||
const requestRedirect = ['follow', 'manual', 'error']
|
||||
|
||||
const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
|
||||
const safeMethodsSet = new Set(safeMethods)
|
||||
|
||||
const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
|
||||
|
||||
@@ -41843,6 +41973,7 @@ const requestDuplex = [
|
||||
|
||||
// http://fetch.spec.whatwg.org/#forbidden-method
|
||||
const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
|
||||
const forbiddenMethodsSet = new Set(forbiddenMethods)
|
||||
|
||||
const subresource = [
|
||||
'audio',
|
||||
@@ -41858,6 +41989,7 @@ const subresource = [
|
||||
'xslt',
|
||||
''
|
||||
]
|
||||
const subresourceSet = new Set(subresource)
|
||||
|
||||
/** @type {globalThis['DOMException']} */
|
||||
const DOMException = globalThis.DOMException ?? (() => {
|
||||
@@ -41907,7 +42039,14 @@ module.exports = {
|
||||
nullBodyStatus,
|
||||
safeMethods,
|
||||
badPorts,
|
||||
requestDuplex
|
||||
requestDuplex,
|
||||
subresourceSet,
|
||||
badPortsSet,
|
||||
redirectStatusSet,
|
||||
corsSafeListedMethodsSet,
|
||||
safeMethodsSet,
|
||||
forbiddenMethodsSet,
|
||||
referrerPolicySet
|
||||
}
|
||||
|
||||
|
||||
@@ -42563,6 +42702,7 @@ const { isBlobLike } = __nccwpck_require__(2538)
|
||||
const { webidl } = __nccwpck_require__(1744)
|
||||
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
|
||||
const { kEnumerableProperty } = __nccwpck_require__(3983)
|
||||
const encoder = new TextEncoder()
|
||||
|
||||
class File extends Blob {
|
||||
constructor (fileBits, fileName, options = {}) {
|
||||
@@ -42836,7 +42976,7 @@ function processBlobParts (parts, options) {
|
||||
}
|
||||
|
||||
// 3. Append the result of UTF-8 encoding s to bytes.
|
||||
bytes.push(new TextEncoder().encode(s))
|
||||
bytes.push(encoder.encode(s))
|
||||
} else if (
|
||||
types.isAnyArrayBuffer(element) ||
|
||||
types.isTypedArray(element)
|
||||
@@ -43834,11 +43974,11 @@ const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
|
||||
const assert = __nccwpck_require__(9491)
|
||||
const { safelyExtractBody } = __nccwpck_require__(1472)
|
||||
const {
|
||||
redirectStatus,
|
||||
redirectStatusSet,
|
||||
nullBodyStatus,
|
||||
safeMethods,
|
||||
safeMethodsSet,
|
||||
requestBodyHeader,
|
||||
subresource,
|
||||
subresourceSet,
|
||||
DOMException
|
||||
} = __nccwpck_require__(1037)
|
||||
const { kHeadersList } = __nccwpck_require__(2785)
|
||||
@@ -43850,6 +43990,7 @@ const { TransformStream } = __nccwpck_require__(5356)
|
||||
const { getGlobalDispatcher } = __nccwpck_require__(1892)
|
||||
const { webidl } = __nccwpck_require__(1744)
|
||||
const { STATUS_CODES } = __nccwpck_require__(3685)
|
||||
const GET_OR_HEAD = ['GET', 'HEAD']
|
||||
|
||||
/** @type {import('buffer').resolveObjectURL} */
|
||||
let resolveObjectURL
|
||||
@@ -43909,7 +44050,7 @@ class Fetch extends EE {
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#fetch-method
|
||||
async function fetch (input, init = {}) {
|
||||
function fetch (input, init = {}) {
|
||||
webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
|
||||
|
||||
// 1. Let p be a new promise.
|
||||
@@ -43992,7 +44133,7 @@ async function fetch (input, init = {}) {
|
||||
const processResponse = (response) => {
|
||||
// 1. If locallyAborted is true, terminate these substeps.
|
||||
if (locallyAborted) {
|
||||
return
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
// 2. If response’s aborted flag is set, then:
|
||||
@@ -44005,7 +44146,7 @@ async function fetch (input, init = {}) {
|
||||
// deserializedError.
|
||||
|
||||
abortFetch(p, request, responseObject, controller.serializedAbortReason)
|
||||
return
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
// 3. If response is a network error, then reject p with a TypeError
|
||||
@@ -44014,7 +44155,7 @@ async function fetch (input, init = {}) {
|
||||
p.reject(
|
||||
Object.assign(new TypeError('fetch failed'), { cause: response.error })
|
||||
)
|
||||
return
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
// 4. Set responseObject to the result of creating a Response object,
|
||||
@@ -44297,7 +44438,7 @@ function fetching ({
|
||||
}
|
||||
|
||||
// 15. If request is a subresource request, then:
|
||||
if (subresource.includes(request.destination)) {
|
||||
if (subresourceSet.has(request.destination)) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -44564,13 +44705,13 @@ async function mainFetch (fetchParams, recursive = false) {
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-scheme-fetch
|
||||
// given a fetch params fetchParams
|
||||
async function schemeFetch (fetchParams) {
|
||||
function schemeFetch (fetchParams) {
|
||||
// Note: since the connection is destroyed on redirect, which sets fetchParams to a
|
||||
// cancelled state, we do not want this condition to trigger *unless* there have been
|
||||
// no redirects. See https://github.com/nodejs/undici/issues/1776
|
||||
// 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
|
||||
if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
|
||||
return makeAppropriateNetworkError(fetchParams)
|
||||
return Promise.resolve(makeAppropriateNetworkError(fetchParams))
|
||||
}
|
||||
|
||||
// 2. Let request be fetchParams’s request.
|
||||
@@ -44586,7 +44727,7 @@ async function schemeFetch (fetchParams) {
|
||||
// and body is the empty byte sequence as a body.
|
||||
|
||||
// Otherwise, return a network error.
|
||||
return makeNetworkError('about scheme is not supported')
|
||||
return Promise.resolve(makeNetworkError('about scheme is not supported'))
|
||||
}
|
||||
case 'blob:': {
|
||||
if (!resolveObjectURL) {
|
||||
@@ -44599,7 +44740,7 @@ async function schemeFetch (fetchParams) {
|
||||
// https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
|
||||
// Buffer.resolveObjectURL does not ignore URL queries.
|
||||
if (blobURLEntry.search.length !== 0) {
|
||||
return makeNetworkError('NetworkError when attempting to fetch resource.')
|
||||
return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
|
||||
}
|
||||
|
||||
const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
|
||||
@@ -44607,7 +44748,7 @@ async function schemeFetch (fetchParams) {
|
||||
// 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
|
||||
// object is not a Blob object, then return a network error.
|
||||
if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
|
||||
return makeNetworkError('invalid method')
|
||||
return Promise.resolve(makeNetworkError('invalid method'))
|
||||
}
|
||||
|
||||
// 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
|
||||
@@ -44634,7 +44775,7 @@ async function schemeFetch (fetchParams) {
|
||||
|
||||
response.body = body
|
||||
|
||||
return response
|
||||
return Promise.resolve(response)
|
||||
}
|
||||
case 'data:': {
|
||||
// 1. Let dataURLStruct be the result of running the
|
||||
@@ -44645,7 +44786,7 @@ async function schemeFetch (fetchParams) {
|
||||
// 2. If dataURLStruct is failure, then return a
|
||||
// network error.
|
||||
if (dataURLStruct === 'failure') {
|
||||
return makeNetworkError('failed to fetch the data URL')
|
||||
return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
|
||||
}
|
||||
|
||||
// 3. Let mimeType be dataURLStruct’s MIME type, serialized.
|
||||
@@ -44654,28 +44795,28 @@ async function schemeFetch (fetchParams) {
|
||||
// 4. Return a response whose status message is `OK`,
|
||||
// header list is « (`Content-Type`, mimeType) »,
|
||||
// and body is dataURLStruct’s body as a body.
|
||||
return makeResponse({
|
||||
return Promise.resolve(makeResponse({
|
||||
statusText: 'OK',
|
||||
headersList: [
|
||||
['content-type', { name: 'Content-Type', value: mimeType }]
|
||||
],
|
||||
body: safelyExtractBody(dataURLStruct.body)[0]
|
||||
})
|
||||
}))
|
||||
}
|
||||
case 'file:': {
|
||||
// For now, unfortunate as it is, file URLs are left as an exercise for the reader.
|
||||
// When in doubt, return a network error.
|
||||
return makeNetworkError('not implemented... yet...')
|
||||
return Promise.resolve(makeNetworkError('not implemented... yet...'))
|
||||
}
|
||||
case 'http:':
|
||||
case 'https:': {
|
||||
// Return the result of running HTTP fetch given fetchParams.
|
||||
|
||||
return await httpFetch(fetchParams)
|
||||
return httpFetch(fetchParams)
|
||||
.catch((err) => makeNetworkError(err))
|
||||
}
|
||||
default: {
|
||||
return makeNetworkError('unknown scheme')
|
||||
return Promise.resolve(makeNetworkError('unknown scheme'))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44694,7 +44835,7 @@ function finalizeResponse (fetchParams, response) {
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#fetch-finale
|
||||
async function fetchFinale (fetchParams, response) {
|
||||
function fetchFinale (fetchParams, response) {
|
||||
// 1. If response is a network error, then:
|
||||
if (response.type === 'error') {
|
||||
// 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
|
||||
@@ -44778,8 +44919,9 @@ async function fetchFinale (fetchParams, response) {
|
||||
} else {
|
||||
// 4. Otherwise, fully read response’s body given processBody, processBodyError,
|
||||
// and fetchParams’s task destination.
|
||||
await fullyReadBody(response.body, processBody, processBodyError)
|
||||
return fullyReadBody(response.body, processBody, processBodyError)
|
||||
}
|
||||
return Promise.resolve()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44850,7 +44992,7 @@ async function httpFetch (fetchParams) {
|
||||
}
|
||||
|
||||
// 8. If actualResponse’s status is a redirect status, then:
|
||||
if (redirectStatus.includes(actualResponse.status)) {
|
||||
if (redirectStatusSet.has(actualResponse.status)) {
|
||||
// 1. If actualResponse’s status is not 303, request’s body is not null,
|
||||
// and the connection uses HTTP/2, then user agents may, and are even
|
||||
// encouraged to, transmit an RST_STREAM frame.
|
||||
@@ -44887,7 +45029,7 @@ async function httpFetch (fetchParams) {
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#http-redirect-fetch
|
||||
async function httpRedirectFetch (fetchParams, response) {
|
||||
function httpRedirectFetch (fetchParams, response) {
|
||||
// 1. Let request be fetchParams’s request.
|
||||
const request = fetchParams.request
|
||||
|
||||
@@ -44913,18 +45055,18 @@ async function httpRedirectFetch (fetchParams, response) {
|
||||
}
|
||||
} catch (err) {
|
||||
// 5. If locationURL is failure, then return a network error.
|
||||
return makeNetworkError(err)
|
||||
return Promise.resolve(makeNetworkError(err))
|
||||
}
|
||||
|
||||
// 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
|
||||
// error.
|
||||
if (!urlIsHttpHttpsScheme(locationURL)) {
|
||||
return makeNetworkError('URL scheme must be a HTTP(S) scheme')
|
||||
return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
|
||||
}
|
||||
|
||||
// 7. If request’s redirect count is 20, then return a network error.
|
||||
if (request.redirectCount === 20) {
|
||||
return makeNetworkError('redirect count exceeded')
|
||||
return Promise.resolve(makeNetworkError('redirect count exceeded'))
|
||||
}
|
||||
|
||||
// 8. Increase request’s redirect count by 1.
|
||||
@@ -44938,7 +45080,7 @@ async function httpRedirectFetch (fetchParams, response) {
|
||||
(locationURL.username || locationURL.password) &&
|
||||
!sameOrigin(request, locationURL)
|
||||
) {
|
||||
return makeNetworkError('cross origin not allowed for request mode "cors"')
|
||||
return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
|
||||
}
|
||||
|
||||
// 10. If request’s response tainting is "cors" and locationURL includes
|
||||
@@ -44947,9 +45089,9 @@ async function httpRedirectFetch (fetchParams, response) {
|
||||
request.responseTainting === 'cors' &&
|
||||
(locationURL.username || locationURL.password)
|
||||
) {
|
||||
return makeNetworkError(
|
||||
return Promise.resolve(makeNetworkError(
|
||||
'URL cannot contain credentials for request mode "cors"'
|
||||
)
|
||||
))
|
||||
}
|
||||
|
||||
// 11. If actualResponse’s status is not 303, request’s body is non-null,
|
||||
@@ -44959,7 +45101,7 @@ async function httpRedirectFetch (fetchParams, response) {
|
||||
request.body != null &&
|
||||
request.body.source == null
|
||||
) {
|
||||
return makeNetworkError()
|
||||
return Promise.resolve(makeNetworkError())
|
||||
}
|
||||
|
||||
// 12. If one of the following is true
|
||||
@@ -44968,7 +45110,7 @@ async function httpRedirectFetch (fetchParams, response) {
|
||||
if (
|
||||
([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
|
||||
(actualResponse.status === 303 &&
|
||||
!['GET', 'HEAD'].includes(request.method))
|
||||
!GET_OR_HEAD.includes(request.method))
|
||||
) {
|
||||
// then:
|
||||
// 1. Set request’s method to `GET` and request’s body to null.
|
||||
@@ -44988,6 +45130,10 @@ async function httpRedirectFetch (fetchParams, response) {
|
||||
if (!sameOrigin(requestCurrentURL(request), locationURL)) {
|
||||
// https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
|
||||
request.headersList.delete('authorization')
|
||||
|
||||
// "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
|
||||
request.headersList.delete('cookie')
|
||||
request.headersList.delete('host')
|
||||
}
|
||||
|
||||
// 14. If request’s body is non-null, then set request’s body to the first return
|
||||
@@ -45132,7 +45278,7 @@ async function httpNetworkOrCacheFetch (
|
||||
// user agents should append `User-Agent`/default `User-Agent` value to
|
||||
// httpRequest’s header list.
|
||||
if (!httpRequest.headersList.contains('user-agent')) {
|
||||
httpRequest.headersList.append('user-agent', __filename.endsWith('index.js') ? 'undici' : 'node')
|
||||
httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
|
||||
}
|
||||
|
||||
// 15. If httpRequest’s cache mode is "default" and httpRequest’s header
|
||||
@@ -45248,7 +45394,7 @@ async function httpNetworkOrCacheFetch (
|
||||
// responses in httpCache, as per the "Invalidation" chapter of HTTP
|
||||
// Caching, and set storedResponse to null. [HTTP-CACHING]
|
||||
if (
|
||||
!safeMethods.includes(httpRequest.method) &&
|
||||
!safeMethodsSet.has(httpRequest.method) &&
|
||||
forwardResponse.status >= 200 &&
|
||||
forwardResponse.status <= 399
|
||||
) {
|
||||
@@ -45808,7 +45954,7 @@ async function httpNetworkFetch (
|
||||
|
||||
const willFollow = request.redirect === 'follow' &&
|
||||
location &&
|
||||
redirectStatus.includes(status)
|
||||
redirectStatusSet.has(status)
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
||||
if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
|
||||
@@ -45948,8 +46094,8 @@ const {
|
||||
makePolicyContainer
|
||||
} = __nccwpck_require__(2538)
|
||||
const {
|
||||
forbiddenMethods,
|
||||
corsSafeListedMethods,
|
||||
forbiddenMethodsSet,
|
||||
corsSafeListedMethodsSet,
|
||||
referrerPolicy,
|
||||
requestRedirect,
|
||||
requestMode,
|
||||
@@ -46254,7 +46400,7 @@ class Request {
|
||||
throw TypeError(`'${init.method}' is not a valid HTTP method.`)
|
||||
}
|
||||
|
||||
if (forbiddenMethods.indexOf(method.toUpperCase()) !== -1) {
|
||||
if (forbiddenMethodsSet.has(method.toUpperCase())) {
|
||||
throw TypeError(`'${init.method}' HTTP method is unsupported.`)
|
||||
}
|
||||
|
||||
@@ -46339,7 +46485,7 @@ class Request {
|
||||
if (mode === 'no-cors') {
|
||||
// 1. If this’s request’s method is not a CORS-safelisted method,
|
||||
// then throw a TypeError.
|
||||
if (!corsSafeListedMethods.includes(request.method)) {
|
||||
if (!corsSafeListedMethodsSet.has(request.method)) {
|
||||
throw new TypeError(
|
||||
`'${request.method} is unsupported in no-cors mode.`
|
||||
)
|
||||
@@ -46901,7 +47047,7 @@ const {
|
||||
isomorphicEncode
|
||||
} = __nccwpck_require__(2538)
|
||||
const {
|
||||
redirectStatus,
|
||||
redirectStatusSet,
|
||||
nullBodyStatus,
|
||||
DOMException
|
||||
} = __nccwpck_require__(1037)
|
||||
@@ -46915,6 +47061,7 @@ const assert = __nccwpck_require__(9491)
|
||||
const { types } = __nccwpck_require__(3837)
|
||||
|
||||
const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
|
||||
const textEncoder = new TextEncoder('utf-8')
|
||||
|
||||
// https://fetch.spec.whatwg.org/#response-class
|
||||
class Response {
|
||||
@@ -46944,7 +47091,7 @@ class Response {
|
||||
}
|
||||
|
||||
// 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
|
||||
const bytes = new TextEncoder('utf-8').encode(
|
||||
const bytes = textEncoder.encode(
|
||||
serializeJavascriptValueToJSONString(data)
|
||||
)
|
||||
|
||||
@@ -46989,7 +47136,7 @@ class Response {
|
||||
}
|
||||
|
||||
// 3. If status is not a redirect status, then throw a RangeError.
|
||||
if (!redirectStatus.includes(status)) {
|
||||
if (!redirectStatusSet.has(status)) {
|
||||
throw new RangeError('Invalid status code ' + status)
|
||||
}
|
||||
|
||||
@@ -47487,7 +47634,7 @@ module.exports = {
|
||||
"use strict";
|
||||
|
||||
|
||||
const { redirectStatus, badPorts, referrerPolicy: referrerPolicyTokens } = __nccwpck_require__(1037)
|
||||
const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
|
||||
const { getGlobalOrigin } = __nccwpck_require__(1246)
|
||||
const { performance } = __nccwpck_require__(4074)
|
||||
const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
|
||||
@@ -47516,7 +47663,7 @@ function responseURL (response) {
|
||||
// https://fetch.spec.whatwg.org/#concept-response-location-url
|
||||
function responseLocationURL (response, requestFragment) {
|
||||
// 1. If response’s status is not a redirect status, then return null.
|
||||
if (!redirectStatus.includes(response.status)) {
|
||||
if (!redirectStatusSet.has(response.status)) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -47551,7 +47698,7 @@ function requestBadPort (request) {
|
||||
|
||||
// 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
|
||||
// then return blocked.
|
||||
if (urlIsHttpHttpsScheme(url) && badPorts.includes(url.port)) {
|
||||
if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
|
||||
return 'blocked'
|
||||
}
|
||||
|
||||
@@ -47693,7 +47840,7 @@ function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
|
||||
// The left-most policy is the fallback.
|
||||
for (let i = policyHeader.length; i !== 0; i--) {
|
||||
const token = policyHeader[i - 1].trim()
|
||||
if (referrerPolicyTokens.includes(token)) {
|
||||
if (referrerPolicyTokens.has(token)) {
|
||||
policy = token
|
||||
break
|
||||
}
|
||||
@@ -58174,8 +58321,15 @@ class Directives {
|
||||
if (!suffix)
|
||||
onError(`The ${source} tag has no suffix`);
|
||||
const prefix = this.tags[handle];
|
||||
if (prefix)
|
||||
return prefix + decodeURIComponent(suffix);
|
||||
if (prefix) {
|
||||
try {
|
||||
return prefix + decodeURIComponent(suffix);
|
||||
}
|
||||
catch (error) {
|
||||
onError(String(error));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (handle === '!')
|
||||
return source; // local tag
|
||||
onError(`Could not resolve tag: ${source}`);
|
||||
|
||||
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.1",
|
||||
"version": "40.0.1",
|
||||
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
|
||||
"main": "lib/main.js",
|
||||
"publishConfig": {
|
||||
|
||||
73
src/utils.ts
73
src/utils.ts
@@ -938,27 +938,7 @@ export const getFilePatterns = async ({
|
||||
inputs: Inputs
|
||||
workingDirectory: string
|
||||
}): Promise<string[]> => {
|
||||
let filePatterns = inputs.files
|
||||
.split(inputs.filesSeparator)
|
||||
.filter(Boolean)
|
||||
.join('\n')
|
||||
|
||||
if (inputs.filesFromSourceFile !== '') {
|
||||
const inputFilesFromSourceFile = inputs.filesFromSourceFile
|
||||
.split(inputs.filesFromSourceFileSeparator)
|
||||
.filter(p => p !== '')
|
||||
.map(p => path.join(workingDirectory, p))
|
||||
|
||||
core.debug(`files from source file: ${inputFilesFromSourceFile}`)
|
||||
|
||||
const filesFromSourceFiles = (
|
||||
await getFilesFromSourceFile({filePaths: inputFilesFromSourceFile})
|
||||
).join('\n')
|
||||
|
||||
core.debug(`files from source files patterns: ${filesFromSourceFiles}`)
|
||||
|
||||
filePatterns = filePatterns.concat('\n', filesFromSourceFiles)
|
||||
}
|
||||
let filePatterns = ''
|
||||
|
||||
if (inputs.filesIgnore) {
|
||||
const filesIgnorePatterns = inputs.filesIgnore
|
||||
@@ -1001,30 +981,47 @@ export const getFilePatterns = async ({
|
||||
filePatterns = filePatterns.concat('\n', filesIgnoreFromSourceFiles)
|
||||
}
|
||||
|
||||
if (inputs.files) {
|
||||
filePatterns = filePatterns.concat(
|
||||
'\n',
|
||||
inputs.files.split(inputs.filesSeparator).filter(Boolean).join('\n')
|
||||
)
|
||||
}
|
||||
|
||||
if (inputs.filesFromSourceFile !== '') {
|
||||
const inputFilesFromSourceFile = inputs.filesFromSourceFile
|
||||
.split(inputs.filesFromSourceFileSeparator)
|
||||
.filter(p => p !== '')
|
||||
.map(p => path.join(workingDirectory, p))
|
||||
|
||||
core.debug(`files from source file: ${inputFilesFromSourceFile}`)
|
||||
|
||||
const filesFromSourceFiles = (
|
||||
await getFilesFromSourceFile({filePaths: inputFilesFromSourceFile})
|
||||
).join('\n')
|
||||
|
||||
core.debug(`files from source files patterns: ${filesFromSourceFiles}`)
|
||||
|
||||
filePatterns = filePatterns.concat('\n', filesFromSourceFiles)
|
||||
}
|
||||
|
||||
if (isWindows()) {
|
||||
filePatterns = filePatterns.replace(/\r\n/g, '\n')
|
||||
filePatterns = filePatterns.replace(/\r/g, '\n')
|
||||
}
|
||||
|
||||
core.debug(`Input file patterns: ${filePatterns}`)
|
||||
const filePatternsArray = filePatterns.trim().split('\n').filter(Boolean)
|
||||
|
||||
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('.')) {
|
||||
return `${pattern}/**`
|
||||
} else {
|
||||
return pattern
|
||||
}
|
||||
}
|
||||
// Reorder file patterns '**' should come before '!**/*.txt' and then the rest 'dir/**/*.txt'
|
||||
if (filePatternsArray.includes('**')) {
|
||||
filePatternsArray.sort((a, b) => {
|
||||
return a === '**' ? -1 : b === '**' ? 1 : 0
|
||||
})
|
||||
}
|
||||
|
||||
core.debug(`Input file patterns: \n${filePatternsArray.join('\n')}`)
|
||||
|
||||
return filePatternsArray
|
||||
}
|
||||
|
||||
// Example YAML input:
|
||||
|
||||
Reference in New Issue
Block a user